import { TableGRole } from "../../../resources/config/ts/TableGRole"; import { GFSMAnimBase } from "../base/fsm/GFSMAnimBase"; import GFSMBase from "../base/fsm/GFSMBase"; import GRoleBase from "../base/role/GRoleBase"; //角色工具类 export class GRoleUtil{ //获取存活的玩家 如果不存活则返回 null static get>(player:T):() => T{ if(!player) return null; return ():T => { if(player) return player.get(); return null; } } //通过Id 获取 GRole static getGRole(id:number):TableGRole{ let info:TableGRole; if(!(info = TableGRole.getConfig(id))) return null; return info } static getGRoles(ids:number[]):TableGRole[]{ return ids.map(id => GRoleUtil.getGRole(id)); } }