public override void Initialize() { RegisterHotkeys(); LuaCore.PopulateSecondryStats(); TalentManager.Init(); TalentManager.Update(); UpdateContext(); // Do this now, so we ensure we update our context when needed. BotEvents.Player.OnMapChanged += e => UpdateContext(); OnWoWContextChanged += (orig, ne) => { Logging.Write("Context changed, re-creating behaviors"); AssignBehaviors(); Spell.GcdInitialize(); Lists.BossList.Init(); }; Spell.GcdInitialize(); Dispelling.Init(); //testing cached units //CachedUnits.Initialize(); EventHandlers.Init(); Lists.BossList.Init(); Instance.AssignBehaviors(); Logging.Write("Initialization Completed"); }
static void Main(string[] args) { Console.WriteLine("battle test start..."); if (args.Length < 2) { Console.WriteLine("error args"); return; } Console.WriteLine("loading from testcase:{0}", args[0]); //XmlSerializer serializer = new XmlSerializer(typeof(TestCaseXml)); //using (StreamReader sr = new StreamReader(testCaseXmlFile)) //{ // testCase = serializer.Deserialize(sr) as TestCaseXml; //} RoleManager.Init(args[0]); TestCaseXml testCase = new TestCaseXml(); testCase.Roles = RoleManager.getRoles(); //Effect EffectManager.Init(args[2]); //Talent TalentManager.Init(args[3]); //Skill 处理 SkillManager.Init(args[1]); Console.WriteLine("loading from skillfile:{0}", args[1]); //将角色技能信息根据skill信息补完 foreach (Role role in testCase.Roles) { role.Skills = SkillManager.updateSkills(role.Skills); role.Talents = TalentManager.updateTalent(role.Talents); } BattleInput input = new BattleInput() { Roles = testCase.Roles }; BattleComputer computer = new BattleComputer(input); BattleResult result = computer.Compute(); DisplayBattleResult(result); Console.ReadKey(); }