public static AIController Instantiate(string dllName, string className, Map map, Champion champion) { Assembly assembly = Assembly.LoadFile(Path.GetFullPath(dllName)); Type t = assembly.GetType(className); ConstructorInfo constructor = t.GetConstructor(new Type[] { typeof(Map), typeof(Champion) }); return constructor.Invoke(new object[] { map, champion }) as AIController; }
public void StartNewGame() { moba = new MobaLib.MobaGame("Testmap.mm"); Champion c = new Champion(moba.Map, moba.Teams[0], new CharacterInfo("Champion.ci"), moba.Map.Lanes[0].Waypoints[0]); c.SetController(AIController.Instantiate("ChampionAIs.dll", "ChampionAIs.TestController", moba.Map, c)); moba.Map.Add(c); Champion c2 = new Champion(moba.Map, moba.Teams[1], new CharacterInfo("Champion.ci"), moba.Map.Lanes[1].Waypoints[0]); c2.SetController(AIController.Instantiate("ChampionAIs.dll", "ChampionAIs.TestController", moba.Map, c2)); moba.Map.Add(c2); //m = new TestMinion(moba.Map, moba.Map.Lanes[0], moba.Teams[0], new CharacterInfo("Minion.ci"), new MobaLib.Vector3(500,0, 500)); //m.SetTarget(new MobaLib.Vector3(500, 0, 500)); //moba.Map.Add(m); }
public TestController(Map map, Champion champion) : base(map, champion) { state = TestControllerState.Laning; }
public AIController(Map map, Champion champion) { this.map = map; this.champion = champion; }
public static AIController Instantiate(string dllName, string className, Map map, Champion champion) { Assembly assembly = Assembly.LoadFile(Path.GetFullPath(dllName)); Type t = assembly.GetType(className); ConstructorInfo constructor = t.GetConstructor(new Type[] { typeof(Map), typeof(Champion) }); return(constructor.Invoke(new object[] { map, champion }) as AIController); }