Passed
Push — depfu/update/npm/lodash-4.17.1... ( 152c97 )
by
unknown
04:58
created

src/app/screens/area-general/area-general.component.ts   A

Complexity

Total Complexity 10
Complexity/F 0

Size

Lines of Code 67
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 38
dl 0
loc 67
rs 10
c 0
b 0
f 0
wmc 10
mnd 10
bc 10
fnc 0
bpm 0
cpm 0
noi 0
1
/**
2
   Copyright 2018 June Hanabi
3
4
   Licensed under the Apache License, Version 2.0 (the "License");
5
   you may not use this file except in compliance with the License.
6
   You may obtain a copy of the License at
7
8
       http://www.apache.org/licenses/LICENSE-2.0
9
10
   Unless required by applicable law or agreed to in writing, software
11
   distributed under the License is distributed on an "AS IS" BASIS,
12
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
   See the License for the specific language governing permissions and
14
   limitations under the License.
15
 */
16
17
import { Component } from '@angular/core';
18
import { SaveFileService } from "../../data/savefile.service";
19
20
@Component({
21
    selector: 'screen-area-general',
22
    templateUrl: './area-general.component.pug',
23
    styleUrls: ['./area-general.component.scss'],
24
})
25
export class AreaGeneralComponent {
26
27
    constructor(
28
        public fileService: SaveFileService,
29
    ) { }
30
31
    get contrastImgUrl() {
32
        const contrast = this.fileService.fileDataExpanded.area.general.contrast;
33
34
        if (contrast == 0)
35
            return 'assets/pokered-contrast/contrast0.png';
36
37
        // 1a and 1b looked the same on the sample image
38
        // No use in including both identical images
39
        else if (contrast == 1)
40
            return 'assets/pokered-contrast/contrast1b.png';
41
        else if (contrast == 2)
42
            return 'assets/pokered-contrast/contrast1b.png';
43
44
        else if (contrast == 3)
45
            return 'assets/pokered-contrast/contrast1.png';
46
47
        else if (contrast == 4)
48
            return 'assets/pokered-contrast/contrast2a.png';
49
        else if (contrast == 5)
50
            return 'assets/pokered-contrast/contrast2b.png';
51
52
        else if (contrast == 6)
53
            return 'assets/pokered-contrast/contrast2.png';
54
55
        // All 3 looked the same on the sample image
56
        else if (contrast == 7)
57
            return 'assets/pokered-contrast/contrast3.png';
58
        else if (contrast == 8)
59
            return 'assets/pokered-contrast/contrast3.png';
60
        else if (contrast == 9)
61
            return 'assets/pokered-contrast/contrast3.png';
62
63
        // Default
64
        return 'assets/pokered-contrast/contrast0.png';
65
    }
66
}
67