示例#1
0
 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;
 }
示例#2
0
文件: Game1.cs 项目: MyEyes/MobaAI
        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);
        }
示例#3
0
 public TestController(Map map, Champion champion)
     : base(map, champion)
 {
     state = TestControllerState.Laning;
 }
示例#4
0
 public AIController(Map map, Champion champion)
 {
     this.map = map;
     this.champion = champion;
 }
示例#5
0
        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);
        }
示例#6
0
 public AIController(Map map, Champion champion)
 {
     this.map      = map;
     this.champion = champion;
 }