add trophy logic
This commit is contained in:
@@ -31,7 +31,7 @@ export class DOBlock {
|
||||
this.checked = show == this.get_correct()
|
||||
if (this.checked == false)
|
||||
this.set_score(0)
|
||||
StorageManager.getInstance().onChanged()
|
||||
StorageManager.getInstance().onStageChanged()
|
||||
}
|
||||
|
||||
public get_score(): number {
|
||||
@@ -39,7 +39,7 @@ export class DOBlock {
|
||||
}
|
||||
public set_score(score: number): void {
|
||||
this.data.score = score
|
||||
StorageManager.getInstance().onChanged()
|
||||
StorageManager.getInstance().onStageChanged()
|
||||
}
|
||||
|
||||
public get_notes(): Array<number> {
|
||||
@@ -48,20 +48,20 @@ export class DOBlock {
|
||||
public add_note(noteNumber: number): void {
|
||||
if (this.data.notes.indexOf(noteNumber) < 0) {
|
||||
this.data.notes.push(noteNumber)
|
||||
StorageManager.getInstance().onChanged()
|
||||
StorageManager.getInstance().onStageChanged()
|
||||
}
|
||||
}
|
||||
public remove_note(noteNumber: number): void {
|
||||
var find = this.data.notes.indexOf(noteNumber)
|
||||
if (find >= 0) {
|
||||
this.data.notes.splice(find, 1)
|
||||
StorageManager.getInstance().onChanged()
|
||||
StorageManager.getInstance().onStageChanged()
|
||||
}
|
||||
}
|
||||
public clean_notes(): void {
|
||||
if (this.data.notes.length > 0) {
|
||||
this.data.notes = new Array()
|
||||
StorageManager.getInstance().onChanged()
|
||||
StorageManager.getInstance().onStageChanged()
|
||||
}
|
||||
}
|
||||
//====================================持久化数据
|
||||
|
||||
Reference in New Issue
Block a user