GameDotMgr.ts 717 Bytes

import { GameRecord } from "../avg/AVG";
import { GameModelManager } from "./model/GameModelManager";

export default class GameDotMgr {
    private static readonly _instance: GameDotMgr = new GameDotMgr();

    public static getInstance(): GameDotMgr {
        return GameDotMgr._instance;
    }

    public async dotClickUI(uiName: string) {
        let recordKey = "click_ui_count_" + uiName + "_t_" + GameModelManager.getCurDayStr();
        let clickCount = GameRecord.globalVariables[recordKey] as number;
        if (undefined === clickCount) {
            clickCount = 0;
        }
        clickCount += 1;
        GameRecord.globalVariables[recordKey] = clickCount;
        GameRecord.saveRecord();
    }

}