public void StartBattle() { mCamps[Consts.CAMP_PLAYER] = new BattleCamp(); mCamps[Consts.CAMP_ENEMY] = new BattleCamp(); //初始化玩家阵营 BattleCamp camp = mCamps[Consts.CAMP_PLAYER]; BattleInfoController controller = camp.BattleInfoController; BattleFields info = controller.Info; InitPlayerTeam(ref camp); controller.AddListener(Consts.N_INTELLIGENTAL_UPDATE, OnPlayerBattleInfoEventHandler); controller.AddListener(Consts.N_INTELLIGENTAL_FINISHED, OnPlayerBattleInfoEventHandler); controller.Dispatch(Consts.N_START_COLLECT_INTELLIGENTAL); //初始化敌军阵营 camp = mCamps[Consts.CAMP_ENEMY]; controller = camp.BattleInfoController; info = controller.Info; BattleHeroController heroContorller; int max = Consts.CAMP_HERO_MAX; for (int i = 0; i < max; i++) { heroContorller = new BattleHeroController(new HeroFields()); //heroContorller.Info.SetIntData(Consts.FN_ID, id); camp.SetCampHero(i, heroContorller); } controller.AddListener(Consts.N_INTELLIGENTAL_UPDATE, OnEnemyBattleInfoEventHandler); controller.AddListener(Consts.N_INTELLIGENTAL_FINISHED, OnEnemyBattleInfoEventHandler); controller.Dispatch(Consts.N_START_COLLECT_INTELLIGENTAL); }
public BattleCamp() { mBattleHeros = new BattleHeroController[Consts.CAMP_HERO_MAX]; BattleInfoController = new BattleInfoController(new BattleFields()); }