| Total Complexity | 3 |
| Complexity/F | 1.5 |
| Lines of Code | 31 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { SaveFileService } from './../../savefile.service'; |
||
| 2 | |||
| 3 | export class SignData { |
||
| 4 | constructor(savefile?: SaveFileService, index?: number) { |
||
| 5 | if (savefile !== undefined) |
||
| 6 | this.load(savefile as SaveFileService, index as number); |
||
| 7 | } |
||
| 8 | |||
| 9 | public load(savefile: SaveFileService, index: number) { |
||
| 10 | const it = savefile.iterator.offsetTo((2 * index) + 0x275D); |
||
| 11 | this.y = it.getByte(); |
||
| 12 | this.x = it.getByte(); |
||
| 13 | |||
| 14 | it.offsetTo((1 * index) + 0x277D); |
||
| 15 | this.text = it.getByte(); |
||
| 16 | } |
||
| 17 | |||
| 18 | public save(saveFile: SaveFileService, index: number) { |
||
| 19 | const it = saveFile.iterator.offsetTo((2 * index) + 0x275D); |
||
| 20 | it.setByte(this.y); |
||
| 21 | it.setByte(this.x); |
||
| 22 | |||
| 23 | it.offsetTo((1 * index) + 0x277D); |
||
| 24 | it.setByte(this.text); |
||
| 25 | } |
||
| 26 | |||
| 27 | public y: number = 0; |
||
| 28 | public x: number = 0; |
||
| 29 | public text: number = 0; |
||
| 30 | } |
||
| 31 |