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

src/app/data/savefile-expanded/sections/Rival.ts   A

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 22
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 3
mnd 1
bc 1
fnc 2
bpm 0.5
cpm 1.5
noi 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A Rival.save 0 4 1
A Rival.load 0 4 2
1
import { SaveFileService } from '../../savefile.service';
2
3
export class Rival {
4
    constructor(saveFile?: SaveFileService) {
5
        if (saveFile !== undefined)
6
            this.load(saveFile as SaveFileService);
7
    }
8
9
    load(saveFile: SaveFileService) {
10
        this.rivalName = saveFile.getStr(0x25F6, 0xB, 7);
11
        this.rivalStarter = saveFile.getHex(0x29C1, 1).toUpperCase().padStart(2, "0");
12
    }
13
14
    save(saveFile: SaveFileService) {
15
        saveFile.setStr(0x25F6, 0xB, 7, this.rivalName);
16
        saveFile.setHex(0x29C1, 1, this.rivalStarter);
17
    }
18
19
    public rivalName: string = "";
20
    public rivalStarter: string = "";
21
}
22