import User from "../../../FrameWork/User/User"; import UserManager from "../../Manager/UserManager"; const { ccclass, property } = cc._decorator; const zhanLanGuanConfig = { fishShowInfo: [ { goodId: 4017, id: 0, name: '机械鲨鱼', url: 'prefab/机械鲨鱼', sIncome: 100000, moveType: 1, moveSpeed: 200 }, { goodId: 4018, id: 1, name: '七彩水母', url: 'prefab/七彩水母', sIncome: 100000, moveType: 2, moveSpeed: 150 }, { goodId: 4019, id: 2, name: '巨头鲲', url: 'prefab/巨头鲲', sIncome: 100000, moveType: 1, moveSpeed: 200 }, { goodId: 4020, id: 3, name: '深海龟王', url: 'prefab/深海龟王', sIncome: 100000, moveType: 1, moveSpeed: 50 }, { goodId: 1713, id: 4, name: '精灵鱼', url: 'prefab/精灵鱼', sIncome: 5000, moveType: 1, moveSpeed: 200 }, { goodId: 1714, id: 5, name: '彩虹鱼', url: 'prefab/彩虹鱼', sIncome: 20000, moveType: 1, moveSpeed: 150 }, { goodId: 1715, id: 6, name: '老咸鱼', url: 'prefab/老咸鱼', sIncome: 30000, moveType: 1, moveSpeed: 200 }, { goodId: 1716, id: 7, name: '碧落龙鱼', url: 'prefab/碧落龙鱼', sIncome: 30000, moveType: 1, moveSpeed: 50 }, { goodId: 1725, id: 8, name: '长腿章鱼', url: 'prefab/克拉肯', sIncome: 50000, moveType: 2, moveSpeed: 200 }, { goodId: 1717, id: 9, name: '翡翠帝蟹', url: 'prefab/翡翠帝王蟹', sIncome: 80000, moveType: 1, moveSpeed: 50 }, { goodId: 4025, id: 10, name: '烟斗龟', url: 'prefab/烟斗龟', sIncome: 50000, moveType: 1, moveSpeed: 50 }, { goodId: 4026, id: 11, name: '黄金海马', url: 'prefab/黄金海马', sIncome: 80000, moveType: 2, moveSpeed: 50 }, ] } export class ZhanLanGuanManager { // 获取鱼的信息 public static getFishShowInfoByGoodId(goodId: number): any { for (let i = 0; i < zhanLanGuanConfig.fishShowInfo.length; i++) { if (zhanLanGuanConfig.fishShowInfo[i].goodId == goodId) { return zhanLanGuanConfig.fishShowInfo[i]; } } return null; } // 获取鱼的信息 public static getFishShowInfoById(id: number): any { for (let i = 0; i < zhanLanGuanConfig.fishShowInfo.length; i++) { if (zhanLanGuanConfig.fishShowInfo[i].id == id) { return zhanLanGuanConfig.fishShowInfo[i]; } } return null; } // 获取每秒收益 public static getIncomeSecondAll() { let allIncome = 0; let showFishDataList = User.getShowFishDataList(); for (let i = 0; i < showFishDataList.length; i++) { let fishShowInfo = this.getFishShowInfoById(showFishDataList[i]); allIncome += fishShowInfo.sIncome; } return allIncome; } // 收获收益 public static harvestIncome() { let allIncome = 0; let showFishDataList = User.getShowFishDataList(); for (let i = 0; i < showFishDataList.length; i++) { } User.setShowFishDataList(showFishDataList); UserManager.addMoney(allIncome); } }