Total Complexity | 3 |
Complexity/F | 1.5 |
Lines of Code | 22 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
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 |