includes to indexof
This commit is contained in:
@@ -43,7 +43,8 @@ export class DOBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public add_note(noteNumber: number): void {
|
public add_note(noteNumber: number): void {
|
||||||
if (!this.data.notes.includes(noteNumber)) {
|
const find = this.data.notes.indexOf(noteNumber)
|
||||||
|
if (find < 0) {
|
||||||
this.data.notes.push(noteNumber)
|
this.data.notes.push(noteNumber)
|
||||||
StorageManager.getInstance().onStageChanged()
|
StorageManager.getInstance().onStageChanged()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -565,7 +565,8 @@ export class Stage extends Laya.Script {
|
|||||||
for (let i = 0; i < this.blocks.length; i++) {
|
for (let i = 0; i < this.blocks.length; i++) {
|
||||||
const block = this.blocks[i]
|
const block = this.blocks[i]
|
||||||
const note_numbers = block.getData().get_notes()
|
const note_numbers = block.getData().get_notes()
|
||||||
if (note_numbers.includes(obj.getData().get_show()))
|
const find = note_numbers.indexOf(obj.getData().get_show())
|
||||||
|
if (find >= 0)
|
||||||
list.push(block)
|
list.push(block)
|
||||||
}
|
}
|
||||||
return list
|
return list
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ export class TrophyRoom extends Laya.Script {
|
|||||||
const monthMap: Map<number, Array<any>> = new Map()
|
const monthMap: Map<number, Array<any>> = new Map()
|
||||||
for (var i = 0; i < infos.length; i++) {
|
for (var i = 0; i < infos.length; i++) {
|
||||||
obj = infos[i]
|
obj = infos[i]
|
||||||
if (!years.includes(obj.year)) {
|
const find = years.indexOf(obj.year)
|
||||||
|
if (find < 0) {
|
||||||
years.push(obj.year)
|
years.push(obj.year)
|
||||||
}
|
}
|
||||||
if (monthMap.has(obj.year) == false) {
|
if (monthMap.has(obj.year) == false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user