== to ===

This commit is contained in:
2025-05-28 19:15:32 +08:00
parent ccfcc4f840
commit 34eec38036
16 changed files with 64 additions and 64 deletions

View File

@@ -33,7 +33,7 @@ export const MONTH_LIST = [
export function G_getMonthInfo(year: number, month: number): any {
for (let i = 0; i < MONTH_LIST.length; i++) {
const obj = MONTH_LIST[i]
if (obj.year == year && obj.month == month) {
if (obj.year === year && obj.month === month) {
return obj
}
}

View File

@@ -11,7 +11,7 @@ export class DOBlock {
this.data = dataBlock
this.preset = preset
this.correct = correct
this.checked = preset || (dataBlock.show == correct)
this.checked = preset || (dataBlock.show === correct)
}
// ====================================持久化数据
@@ -25,7 +25,7 @@ export class DOBlock {
public set_show(show: number): void {
this.data.show = show
this.checked = show == this.get_correct()
this.checked = show === this.get_correct()
StorageManager.getInstance().onStageChanged()
}

View File

@@ -51,7 +51,7 @@ export class DOUser {
let find: StageProgress
for (let i = 0; i < this.data.dones.length; i++) {
const obj = this.data.dones[i]
if (obj.stageID == stageID) {
if (obj.stageID === stageID) {
find = obj
break
}
@@ -71,7 +71,7 @@ export class DOUser {
let find: TrophyRecord
for (let i = 0; i < this.data.trophy_records.length; i++) {
const obj = this.data.trophy_records[i]
if (obj.year == year && obj.month == month) {
if (obj.year === year && obj.month === month) {
find = obj
break
}
@@ -102,7 +102,7 @@ export class DOUser {
let unread = false
for (let i = 0; i < this.data.trophy_records.length; i++) {
const obj = this.data.trophy_records[i]
if (obj.read == false) {
if (obj.read === false) {
unread = true
break
}
@@ -114,7 +114,7 @@ export class DOUser {
let changed = false
for (let i = 0; i < this.data.trophy_records.length; i++) {
const obj = this.data.trophy_records[i]
if (obj.read == false) {
if (obj.read === false) {
obj.read = true
changed = true
}
@@ -128,7 +128,7 @@ export class DOUser {
let find
for (let i = 0; i < this.data.trophy_records.length; i++) {
const obj = this.data.trophy_records[i]
if (obj.year == year && obj.month == month) {
if (obj.year === year && obj.month === month) {
find = obj
break
}
@@ -144,7 +144,7 @@ export class DOUser {
let find: DataProgress
for (let i = 0; i < this.data.progresses.length; i++) {
const obj = this.data.progresses[i]
if (obj.difficulty == difficulty) {
if (obj.difficulty === difficulty) {
find = obj
break
}
@@ -159,7 +159,7 @@ export class DOUser {
let find: DataProgress
for (let i = 0; i < this.data.progresses.length; i++) {
const obj = this.data.progresses[i]
if (obj.difficulty == difficulty) {
if (obj.difficulty === difficulty) {
find = obj
break
}

View File

@@ -17,7 +17,7 @@ export class EventManager {
private listeners: Map<string, Array<any>> = new Map()
public RegisterEvent(eventID: string, func: any): void {
if (this.listeners.has(eventID) == false) {
if (this.listeners.has(eventID) === false) {
this.listeners.set(eventID, [])
}
const list: Array<any> = this.listeners.get(eventID)

View File

@@ -59,14 +59,14 @@ export class StorageManager {
this.stageChanged = true
let index
if (type == config.STAGE_TYPE.MAIN) { // 主线关卡
if (type === config.STAGE_TYPE.MAIN) { // 主线关卡
index = this.user.get_progress(difficulty)
const levelStr = LevelManager.getInstance().getLevelStr(difficulty, index)
if (!levelStr || levelStr.length <= 0) { // 说明当前难度已经打通了,所以给他从头开始
index = 0
this.user.update_progress(difficulty, index)
}
} else if (type == config.STAGE_TYPE.DC) { // 每天调整如果已经创建过关卡那么就用之前的关卡配置
} else if (type === config.STAGE_TYPE.DC) { // 每天调整如果已经创建过关卡那么就用之前的关卡配置
const value = this.getStage(stageID)
if (value) {
difficulty = value.get_difficulty()