046eb92e-fe2a-4cff-ab74-08d9fad5dca1.js 21.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534
"use strict";
cc._RF.push(module, '046ebku/ipM/6t0CNn61dyh', 'BedRoomCatModelManager');
// script/game/model/BedRoomCatModelManager.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BedRoomCatModelManager = exports.BackgroundType = exports.SuitStatus = exports.ClothingType = exports.CatRewardConfigTpye = void 0;
const simba_config_manager_1 = require("simba-config-manager");
const simba_sdk_1 = require("simba-sdk");
const AVG_1 = require("../../avg/AVG");
const CatFoodConfig_1 = require("../../config/CatFoodConfig");
const CatLevelConfig_1 = require("../../config/CatLevelConfig");
const CatRewardConfig_1 = require("../../config/CatRewardConfig");
const SuitConfig_1 = require("../../config/SuitConfig");
const RewardLoginItem_1 = require("../ui/RewardLoginItem");
const GameModelManager_1 = require("./GameModelManager");
var CatRewardConfigTpye;
(function (CatRewardConfigTpye) {
    CatRewardConfigTpye[CatRewardConfigTpye["CatLoginRewardConfig"] = 1] = "CatLoginRewardConfig";
    CatRewardConfigTpye[CatRewardConfigTpye["CatLevelRewardConfig"] = 2] = "CatLevelRewardConfig";
    CatRewardConfigTpye[CatRewardConfigTpye["CatPlotRewardConfig"] = 3] = "CatPlotRewardConfig";
})(CatRewardConfigTpye = exports.CatRewardConfigTpye || (exports.CatRewardConfigTpye = {}));
var ClothingType;
(function (ClothingType) {
    ClothingType[ClothingType["Suit"] = 0] = "Suit";
    ClothingType[ClothingType["Hair"] = 1] = "Hair";
    ClothingType[ClothingType["Clothed"] = 2] = "Clothed";
    ClothingType[ClothingType["Shoe"] = 3] = "Shoe";
})(ClothingType = exports.ClothingType || (exports.ClothingType = {}));
var SuitStatus;
(function (SuitStatus) {
    SuitStatus[SuitStatus["Lock"] = 0] = "Lock";
    SuitStatus[SuitStatus["Unlock"] = 1] = "Unlock";
    SuitStatus[SuitStatus["Wear"] = 2] = "Wear";
})(SuitStatus = exports.SuitStatus || (exports.SuitStatus = {}));
/**
 * 卧室背景图
 */
var BackgroundType;
(function (BackgroundType) {
    BackgroundType[BackgroundType["Original"] = 0] = "Original";
    BackgroundType[BackgroundType["Halloween"] = 1] = "Halloween";
})(BackgroundType = exports.BackgroundType || (exports.BackgroundType = {}));
class BedRoomCatModelManager1 {
    constructor() {
        /**存档Key */
        this.CatFoodNumber = "CatFoodNumber_";
        this.CatFoodAdTimes = "CatFoodAdTimes_";
        this.LastLoginTime = "LastLoginTime";
        this.TotalLoginDays = "TotalLoginDays";
        this.CatLevel = "CatLevel";
        this.CatExp = "CatExp";
        this.CatRewardStatus = "CatRewardStatus_";
        this.UnlockSuit = "UnlockSuit_";
        this.UsingSuitId = "UsingSuitId";
        this.ShareSuitId = "ShareSuitId";
        this.ClickedSuitId = "ClickedSuitId";
        this.BackgroundType = "BackgroundType";
    }
    /**
     * 通过猫粮Id增加该猫粮的数量存档
     * @param foodId 猫粮Id
     * @param number 新增的数量
     */
    addCatFoodNumberByFoodId(foodId, number) {
        let catFoodNumber = AVG_1.GameRecord.globalVariables[this.CatFoodNumber + foodId];
        let newCatFoodNumber = catFoodNumber ? catFoodNumber + number : number;
        let temp = newCatFoodNumber;
        AVG_1.GameRecord.globalVariables[this.CatFoodNumber + foodId] = temp;
        AVG_1.GameRecord.saveRecord();
    }
    /**
     * 通过猫粮Id减少该猫粮的数量存档
     * @param foodId 猫粮Id
     * @param number 减少的数量
     */
    reduceCatFoodNumberByFoodId(foodId, number = 1) {
        let catFoodNumber = AVG_1.GameRecord.globalVariables[this.CatFoodNumber + foodId];
        let newCatFoodNumber = catFoodNumber ? catFoodNumber - number : 0;
        let temp = newCatFoodNumber;
        AVG_1.GameRecord.globalVariables[this.CatFoodNumber + foodId] = temp;
        AVG_1.GameRecord.saveRecord();
    }
    /**
     * 通过猫粮Id设置该猫粮的数量存档
     * @param foodId 猫粮Id
     * @param number 修改的数量
     */
    setCatFoodNumberByFoodId(foodId, number) {
        number = number >= 0 ? number : 0;
        AVG_1.GameRecord.globalVariables[this.CatFoodNumber + foodId] = number;
        AVG_1.GameRecord.saveRecord();
    }
    /**
     * 通过猫粮Id获取该猫粮现有的数量
     * @param foodId 猫粮Id
     * @returns 返回值为猫粮现有的数量
     */
    getCatFoodNumberByFoodId(foodId) {
        let catFoodNumber = AVG_1.GameRecord.globalVariables[this.CatFoodNumber + foodId];
        return catFoodNumber ? catFoodNumber : 0;
    }
    /**
     * 获取猫粮配置信息
     * @returns 返回值为猫粮配置信息的数组
     */
    getCatFoodConfig() {
        let ret = [];
        let cfg = simba_config_manager_1.ConfigManager.getAllConfig(CatFoodConfig_1.catFoodConfig);
        for (let id in cfg) {
            ret.push({
                id: Number(id), name: cfg[id].name, limitAdEveryDay: cfg[id].limitAdEveryDay,
                numberEveryAd: cfg[id].numberEveryAd, exp: cfg[id].exp, introduction: cfg[id].introduction
            });
        }
        return ret;
    }
    /**
     * 通过猫粮Id新增广告获取该猫粮的次数
     * @param foodId 猫粮Id
     */
    addAdTimesByFoodId(foodId) {
        let catFoodAdTimes = AVG_1.GameRecord.globalVariables[this.CatFoodAdTimes + foodId];
        let newCatFoodAdTimes = catFoodAdTimes ? catFoodAdTimes + 1 : 1;
        let temp = newCatFoodAdTimes;
        AVG_1.GameRecord.globalVariables[this.CatFoodAdTimes + foodId] = temp;
        AVG_1.GameRecord.saveRecord();
    }
    /**
     * 通过猫粮Id获取该猫粮观看广告的剩余次数
     * @param foodId 猫粮Id
     * @returns 返回值为该猫粮观看广告的剩余次数
     */
    getRemainingTimesByFoodId(foodId) {
        let catFoodAdTimes = AVG_1.GameRecord.globalVariables[this.CatFoodAdTimes + foodId];
        catFoodAdTimes = catFoodAdTimes ? catFoodAdTimes : 0;
        let remainingTimes = this.getCatFoodConfig()[foodId - 1].limitAdEveryDay - catFoodAdTimes;
        return remainingTimes ? remainingTimes : 0;
    }
    /**
     * 检查是否为新的一天
     * 刷新每日通过观看广告获取猫粮的次数
     * 记录累计登录天数
     */
    checkIsNextDay() {
        let lastLoginTime = AVG_1.GameRecord.globalVariables[this.LastLoginTime];
        let totalLoginDays = AVG_1.GameRecord.globalVariables[this.TotalLoginDays];
        if (lastLoginTime && totalLoginDays) {
            let overdue = GameModelManager_1.GameModelManager.checkOverdue(lastLoginTime);
            if (overdue) {
                let catFoodConfig = this.getCatFoodConfig();
                //刷新每日通过观看广告获取猫粮的次数
                for (let i = 0; i < catFoodConfig.length; i++) {
                    AVG_1.GameRecord.globalVariables[this.CatFoodAdTimes + catFoodConfig[i].id] = 0;
                }
                AVG_1.GameRecord.globalVariables[this.LastLoginTime] = simba_sdk_1.TimeManager.getTime();
                //记录累计登录天数
                AVG_1.GameRecord.globalVariables[this.TotalLoginDays] = totalLoginDays + 1;
            }
        }
        else {
            AVG_1.GameRecord.globalVariables[this.LastLoginTime] = simba_sdk_1.TimeManager.getTime();
            //记录累计登录天数
            AVG_1.GameRecord.globalVariables[this.TotalLoginDays] = totalLoginDays ? totalLoginDays + 1 : 1;
        }
    }
    /**
     * 初始化奖励的状态
     */
    initCatRewardStatus() {
        //初始化登录奖励的状态
        let loginRewardStatus = AVG_1.GameRecord.globalVariables[this.CatRewardStatus + CatRewardConfigTpye.CatLoginRewardConfig];
        if (!loginRewardStatus) {
            let tmp = [];
            for (let i = 0; i < this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatLoginRewardConfig).length; i++) {
                tmp.push(0);
            }
            loginRewardStatus = tmp;
        }
        if (loginRewardStatus.length < this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatLoginRewardConfig).length) {
            let difference = this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatLoginRewardConfig).length - loginRewardStatus.length;
            for (let i = 0; i < difference; i++) {
                loginRewardStatus.push(0);
            }
        }
        let totalLoginDays = this.getTotalLoginDays();
        for (let i = 0; i < totalLoginDays; i++) {
            if (loginRewardStatus[i] == RewardLoginItem_1.CatRewardStatus.unlock) {
                loginRewardStatus[i] = RewardLoginItem_1.CatRewardStatus.available;
            }
        }
        let tempLoginRewardStatus = [...loginRewardStatus];
        AVG_1.GameRecord.globalVariables[this.CatRewardStatus + CatRewardConfigTpye.CatLoginRewardConfig] = tempLoginRewardStatus;
        //初始化等级奖励的状态
        let levelRewardStatus = AVG_1.GameRecord.globalVariables[this.CatRewardStatus + CatRewardConfigTpye.CatLevelRewardConfig];
        if (!levelRewardStatus) {
            let tmp = [];
            for (let i = 0; i < this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatLevelRewardConfig).length; i++) {
                tmp.push(0);
            }
            levelRewardStatus = tmp;
        }
        if (levelRewardStatus.length < this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatLevelRewardConfig).length) {
            let difference = this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatLevelRewardConfig).length - levelRewardStatus.length;
            for (let i = 0; i < difference; i++) {
                levelRewardStatus.push(0);
            }
        }
        let catLevel = this.getCatLevel();
        for (let i = 0; i < catLevel; i++) {
            if (levelRewardStatus[i] == RewardLoginItem_1.CatRewardStatus.unlock) {
                levelRewardStatus[i] = RewardLoginItem_1.CatRewardStatus.available;
            }
        }
        let tempLevelRewardStatus = [...levelRewardStatus];
        AVG_1.GameRecord.globalVariables[this.CatRewardStatus + CatRewardConfigTpye.CatLevelRewardConfig] = tempLevelRewardStatus;
        //初始化章节奖励的状态
        let plotRewardStatus = AVG_1.GameRecord.globalVariables[this.CatRewardStatus + CatRewardConfigTpye.CatPlotRewardConfig];
        if (!plotRewardStatus) {
            let tmp = [];
            for (let i = 0; i < this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatPlotRewardConfig).length; i++) {
                tmp.push(0);
            }
            plotRewardStatus = tmp;
        }
        if (plotRewardStatus.length < this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatPlotRewardConfig).length) {
            let difference = this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatPlotRewardConfig).length - plotRewardStatus.length;
            for (let i = 0; i < difference; i++) {
                plotRewardStatus.push(0);
            }
        }
        let largestChapterId = this.getLargestCompletedChapterId();
        for (let i = 0; i < this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatPlotRewardConfig).length; i++) {
            if (this.getCatRewardConfigByConfigType(CatRewardConfigTpye.CatPlotRewardConfig)[i].rewardUnlockCondition <= largestChapterId) {
                if (plotRewardStatus[i] == RewardLoginItem_1.CatRewardStatus.unlock) {
                    plotRewardStatus[i] = RewardLoginItem_1.CatRewardStatus.available;
                }
            }
        }
        let tempPlotRewardStatus = [...plotRewardStatus];
        AVG_1.GameRecord.globalVariables[this.CatRewardStatus + CatRewardConfigTpye.CatPlotRewardConfig] = tempPlotRewardStatus;
        //防止在加载界面保存会造成存档丢失的问题
        //GameRecord.autoSave();
    }
    /**
     * 根据奖励类型获取奖励的状态
     * @param catRewardConfigTpye 奖励类型
     * @returns 返回值为奖励的状态数组
     */
    getCatRewardStatus(catRewardConfigTpye) {
        let catRewardStatus = AVG_1.GameRecord.globalVariables[this.CatRewardStatus + catRewardConfigTpye];
        return catRewardStatus ? catRewardStatus : [];
    }
    /**
     * 根据奖励类型和按钮序号(任务序号)改变对应任务的奖励状态
     * @param catRewardConfigTpye 奖励类型
     * @param btnNumber 按钮序号
     */
    changeCatRewardStatus(catRewardConfigTpye, btnNumber) {
        let catRewardStatus = AVG_1.GameRecord.globalVariables[this.CatRewardStatus + catRewardConfigTpye];
        if (catRewardStatus) {
            if (catRewardStatus[btnNumber] == RewardLoginItem_1.CatRewardStatus.available) {
                catRewardStatus[btnNumber] = RewardLoginItem_1.CatRewardStatus.received;
            }
            let temp = [...catRewardStatus];
            AVG_1.GameRecord.globalVariables[this.CatRewardStatus + catRewardConfigTpye] = temp;
            AVG_1.GameRecord.saveRecord();
        }
        else {
            console.error("TotalLoginDaysStatus is not found");
        }
    }
    /**
     * 获取累计登录的天数
     * @returns 返回值为累计登录的天数
     */
    getTotalLoginDays() {
        let totalLoginDays = AVG_1.GameRecord.globalVariables[this.TotalLoginDays];
        return totalLoginDays ? totalLoginDays : 0;
    }
    /**
     * 保存饭统等级到存档
     * @param level 饭统等级
     */
    saveCatLevel(level) {
        AVG_1.GameRecord.globalVariables[this.CatLevel] = level;
        AVG_1.GameRecord.saveRecord();
    }
    /**
     * 获取饭统的等级
     * @returns 返回值为饭统的等级
     */
    getCatLevel() {
        let catLevel = AVG_1.GameRecord.globalVariables[this.CatLevel];
        return catLevel ? catLevel : 0;
    }
    /**
     * 增加饭统的经验值
     * @param exp 新增的经验值
     */
    addCatExp(exp) {
        let catExp = this.getCatExp();
        AVG_1.GameRecord.globalVariables[this.CatExp] = catExp + exp;
        AVG_1.GameRecord.saveRecord();
    }
    /**
     * 获取饭统的经验值
     * @returns 返回值为饭统的经验值
     */
    getCatExp() {
        let catExp = AVG_1.GameRecord.globalVariables[this.CatExp];
        return catExp ? catExp : 0;
    }
    /**
     * 获取当前完成的最大的主线章节
     * @returns 返回值为当前完成的最大的主线章节
     */
    getLargestCompletedChapterId() {
        let chapterId = 0;
        let models = GameModelManager_1.GameModelManager.getMainDatingEventScenesModel();
        for (let i = 0; i < models.length; i++) {
            if (models[i].status == 4) {
                chapterId = models[i].config.id;
            }
        }
        return chapterId;
    }
    /**
     * 根据奖励类型获取对应的奖励配置信息
     * @param catRewardConfigTpye 奖励类型
     * @returns 返回值为奖励配置信息
     */
    getCatRewardConfigByConfigType(catRewardConfigTpye) {
        let ret = [];
        let cfg = simba_config_manager_1.ConfigManager.getAllConfig(CatRewardConfig_1.catRewardConfig);
        for (let id in cfg) {
            if (cfg[id].rewardType == catRewardConfigTpye) {
                ret.push({
                    id: Number(id), rewardTpye: cfg[id].rewardType, rewardUnlockCondition: cfg[id].rewardUnlockCondition, rewardTaskDescription: cfg[id].rewardTaskDescription,
                    catFoodNumber: cfg[id].CatFoodNumber, cannedNumber: cfg[id].CannedNumber, clothedId: cfg[id].ClothesId, specialPlotId: cfg[id].SpecialPlotId
                });
            }
        }
        return ret;
    }
    /**
     * 获取饭统等级配置信息
     * @returns 返回值为饭统等级配置信息
     */
    getCatLevelConfig() {
        let ret = [];
        let cfg = simba_config_manager_1.ConfigManager.getAllConfig(CatLevelConfig_1.catLevelConfig);
        for (let id in cfg) {
            ret.push({ level: cfg[id].level, totalExp: cfg[id].totalExp, expForLevelUp: cfg[id].expForLevelUp });
        }
        return ret;
    }
    /**
     * 根据套装ID获取该套装的配置信息表
     * @param suitId 套装ID
     * @returns 返回值为该套装的配置信息表
     */
    getSuitConfigBySuitId(suitId) {
        let ret = [];
        let cfg = simba_config_manager_1.ConfigManager.getAllConfig(SuitConfig_1.suitConfig);
        for (let id in cfg) {
            if (suitId == cfg[id].suitId) {
                ret.push({
                    clothingType: cfg[id].clothingType, clothingId: cfg[id].clothingId, suitId: cfg[id].suitId,
                    clothingName: cfg[id].clothingName, unlockCondition: cfg[id].unlockCondition, isUnlock: cfg[id].isUnlock
                });
            }
        }
        return ret;
    }
    /**
     * 根据套装ID保存该套装已解锁的服装
     * @param suitId 套装ID
     * @param clothingId 服装ID
     */
    saveUnlockClothingBySuitId(suitId, clothingId) {
        let unlockClothing = AVG_1.GameRecord.globalVariables[this.UnlockSuit + suitId];
        unlockClothing = unlockClothing ? unlockClothing : [];
        if (unlockClothing.indexOf(clothingId) == -1) {
            unlockClothing.push(clothingId);
            let temp = [...unlockClothing];
            AVG_1.GameRecord.globalVariables[this.UnlockSuit + suitId] = temp;
            AVG_1.GameRecord.saveRecord();
        }
    }
    /**
     * 根据套装ID获取该套装已解锁的服装
     * @param suitId 套装ID
     * @returns 返回值为该套装已解锁的服装
     */
    getUnlockClothingBySuitId(suitId) {
        let unlockClothing = AVG_1.GameRecord.globalVariables[this.UnlockSuit + suitId];
        unlockClothing = unlockClothing ? unlockClothing : [];
        return unlockClothing;
    }
    /**
     * 通过套装ID获取该套装现在的穿着状态
     * @param suitId 套装ID
     * @returns 返回值为该套装的穿着状态
     */
    checkSuitStatus(suitId) {
        let suitConfig = this.getSuitConfigBySuitId(suitId);
        let unlockClothing = this.getUnlockClothingBySuitId(suitId);
        let usingSuitId = this.getUsingSuitId();
        if (suitConfig.length !== unlockClothing.length) {
            return SuitStatus.Lock;
        }
        if (suitId !== usingSuitId) {
            return SuitStatus.Unlock;
        }
        else {
            return SuitStatus.Wear;
        }
    }
    /**
     * 存储被点击过的套装ID
     * @param suitId 套装ID
     */
    saveSuitIsClicked(suitId) {
        let clickedSuitId = AVG_1.GameRecord.globalVariables[this.ClickedSuitId];
        clickedSuitId = clickedSuitId ? clickedSuitId : [];
        if (clickedSuitId.indexOf(suitId) == -1) {
            clickedSuitId.push(suitId);
            let temp = [...clickedSuitId];
            AVG_1.GameRecord.globalVariables[this.ClickedSuitId] = temp;
            AVG_1.GameRecord.saveRecord();
        }
    }
    /**
     * 通过套装ID获取该套装有没有被点击过
     * @param suitId 套装ID
     * @returns 返回值为该套装有没有被点击过
     */
    getSuitIsClicked(suitId) {
        let clickedSuitId = AVG_1.GameRecord.globalVariables[this.ClickedSuitId];
        clickedSuitId = clickedSuitId ? clickedSuitId : [];
        if (clickedSuitId.indexOf(suitId) == -1) {
            return false;
        }
        return true;
    }
    /**
     * 保存分享过的套装ID到存档
     * @param suitId 套装ID
     */
    saveSuitShareStatusBySuitId(suitId) {
        let shareSuitId = AVG_1.GameRecord.globalVariables[this.ShareSuitId];
        shareSuitId = shareSuitId ? shareSuitId : [];
        if (shareSuitId.indexOf(suitId) == -1) {
            shareSuitId.push(suitId);
            let temp = [...shareSuitId];
            AVG_1.GameRecord.globalVariables[this.ShareSuitId] = temp;
            AVG_1.GameRecord.saveRecord();
        }
    }
    /**
     * 根据套装ID检查该套装是否被分享过
     * @param suitId 套装ID
     * @returns 返回值为该套装是否被分享过
     */
    checkIsShowSuitShareBtnBySuitId(suitId) {
        let suitConfig = this.getSuitConfigBySuitId(suitId);
        let unlockClothing = this.getUnlockClothingBySuitId(suitId);
        if (suitConfig.length !== unlockClothing.length) {
            return false;
        }
        let shareSuitId = AVG_1.GameRecord.globalVariables[this.ShareSuitId];
        shareSuitId = shareSuitId ? shareSuitId : [];
        let isShow = shareSuitId.indexOf(suitId) == -1;
        return isShow;
    }
    /**
     * 清除分享套装的存档记录
     */
    clearSuitShareRecord() {
        AVG_1.GameRecord.globalVariables[this.ShareSuitId] = [];
        AVG_1.GameRecord.saveRecord();
    }
    /**
     * 改变使用中的套装Id
     * @param suitId 套装Id
     */
    changeUsingSuitId(suitId) {
        AVG_1.GameRecord.globalVariables[this.UsingSuitId] = suitId;
        AVG_1.GameRecord.saveRecord();
    }
    /**
     * 获取正在使用中的套装ID
     * @returns 返回值为正在使用中的套装ID
     */
    getUsingSuitId() {
        let usingSuitId = AVG_1.GameRecord.globalVariables[this.UsingSuitId];
        usingSuitId = usingSuitId ? usingSuitId : 1;
        return usingSuitId;
    }
    /**
     * 保存卧室背景类型
     * @param type 卧室背景类型
     */
    setBackgroundType(type) {
        AVG_1.GameRecord.globalVariables[this.BackgroundType] = type;
        AVG_1.GameRecord.saveRecord();
    }
    /**
     * 获取卧室背景类型
     * @returns 返回值为卧室背景类型
     */
    getBackgroundType() {
        let type = AVG_1.GameRecord.globalVariables[this.BackgroundType];
        type = type ? type : BackgroundType.Original;
        return type;
    }
    /**
     * 检查是否可更换卧室背景
     * @returns 返回值为是否可更换卧室背景
     */
    checkUnlockChangeBackground() {
        let canChange = false;
        let plotId = 12698; //55章剧情最后一个剧情ID
        let record = AVG_1.GameRecord.getPlotsInfo();
        if (record[`${plotId}`] && record[`${plotId}`].cnt >= 1) {
            canChange = true;
        }
        return canChange;
    }
}
exports.BedRoomCatModelManager = new BedRoomCatModelManager1();

cc._RF.pop();