"use strict"; cc._RF.push(module, 'a1aa6boItVC84F8MhXqHGe7', 'battle_role_pool'); // Scripts/mod/battle/battle_role_pool.js "use strict"; // -------------------------------------------------------------------- // @author: shiraho@syg.com(必填, 创建模块的人员) // @description: // 战斗中需要的对象的对象池,区分真假战斗 //
Create: new Date().toISOString() // -------------------------------------------------------------------- var BattleRolePool = cc.Class({ "extends": BaseClass, statics: { instance: null }, initConfig: function initConfig() { this.realPools = new cc.NodePool(); // 战斗对象的预制体缓存对象池 this.effectPools = new cc.NodePool(); // 战斗特效缓存对象池 this.fontPools = new cc.NodePool(); // 战斗中的程序字缓存,主要是被动或者buff播报 this.buffpools = new cc.NodePool(); // 战斗中的buff图标缓存 this.dmgPoolsList = {}; // 战斗中伤害具体区分的对象池 }, // 返回这个对象池 getRealPools: function getRealPools() { return this.realPools; }, // 战斗对象丢到对象池中 pushBackRole: function pushBackRole(role) { this.realPools.put(role); }, // 获取特效对象池 getEffectPools: function getEffectPools() { return this.effectPools; }, // 回收特效对象池 pushBackEffect: function pushBackEffect(effect) { this.effectPools.put(effect); }, // 返回文字对象 getFontPools: function getFontPools() { return this.fontPools; }, // 回收文字对象 pushBackFont: function pushBackFont(font) { this.fontPools.put(font); }, // bufficon对象 getBuffPools: function getBuffPools() { return this.buffpools; }, // 回收buff对象 pushBackBuffPools: function pushBackBuffPools(buff) { this.buffpools.put(buff); }, // 战斗治疗和伤害数字节点对象池 getDmgPools: function getDmgPools(type) { var pool = this.dmgPoolsList[type]; if (pool == null) { pool = new cc.NodePool(); this.dmgPoolsList[type] = pool; } return pool; }, // 回收伤害数字 pushBackDmgPools: function pushBackDmgPools(type, dmg) { var pool = this.dmgPoolsList[type]; if (pool == null) { pool = new cc.NodePool(); this.dmgPoolsList[type] = pool; } pool.put(dmg); } }); BattleRolePool.getInstance = function () { if (!BattleRolePool.instance) { BattleRolePool.instance = new BattleRolePool(); BattleRolePool.instance.initConfig(); } return BattleRolePool.instance; }; module.exports = BattleRolePool; cc._RF.pop();