优化存档逻辑
This commit is contained in:
@@ -32,7 +32,7 @@ export class DOBlock {
|
||||
this.checked = true
|
||||
if (this.get_checked() || show == 0)
|
||||
this.clean_notes()//正确或者擦除
|
||||
StorageManager.getInstance().saveStage()
|
||||
StorageManager.getInstance().onChanged()
|
||||
}
|
||||
|
||||
public get_score(): number {
|
||||
@@ -40,7 +40,7 @@ export class DOBlock {
|
||||
}
|
||||
public set_score(score: number): void {
|
||||
this.data.score = score
|
||||
StorageManager.getInstance().saveStage()
|
||||
StorageManager.getInstance().onChanged()
|
||||
}
|
||||
|
||||
public get_notes(): Array<number> {
|
||||
@@ -50,7 +50,7 @@ export class DOBlock {
|
||||
var b = false
|
||||
if (this.data.notes.indexOf(noteNumber) < 0) {
|
||||
this.data.notes.push(noteNumber)
|
||||
StorageManager.getInstance().saveStage()
|
||||
StorageManager.getInstance().onChanged()
|
||||
b = true
|
||||
}
|
||||
return b
|
||||
@@ -58,7 +58,7 @@ export class DOBlock {
|
||||
public clean_notes(): void {
|
||||
if (this.data.notes.length > 0) {
|
||||
this.data.notes = new Array()
|
||||
StorageManager.getInstance().saveStage()
|
||||
StorageManager.getInstance().onChanged()
|
||||
}
|
||||
}
|
||||
//====================================持久化数据
|
||||
|
||||
Reference in New Issue
Block a user