junebug12851/pokered-save-editor

View on GitHub
src/app/data/savefile-expanded/sections/Area/AreaGeneral.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { SaveFileService } from './../../../savefile.service';
 
export class AreaGeneral {
constructor(saveFile?: SaveFileService) {
if statements must be braced
if (saveFile !== undefined)
this.load(saveFile as SaveFileService);
}
 
public load(saveFile: SaveFileService) {
this.contrast = saveFile.getByte(0x2609);
this.noLetterDelay = saveFile.getBit(0x29DC, 1, 6);
this.countPlaytime = saveFile.getBit(0x29DE, 1, 0);
}
 
public save(saveFile: SaveFileService) {
saveFile.setByte(0x2609, this.contrast);
saveFile.setBit(0x29DC, 1, 6, this.noLetterDelay);
saveFile.setBit(0x29DE, 1, 0, this.countPlaytime);
}
 
Type number trivially inferred from a number literal, remove type annotation
public contrast: number = 0;
Type boolean trivially inferred from a boolean literal, remove type annotation
public noLetterDelay: boolean = false;
Type boolean trivially inferred from a boolean literal, remove type annotation
public countPlaytime: boolean = false;
}