public void Run() { time = 0; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); this.InitialScene(); this.controler = new KeyBoard(space); this.DrawerDevice = new DrawGameObject(space); this.bossBrain = new Brain(); this.bossBrainOne = new Brain(); this.bossBrainTwo = new Brain(); this.bossControler = new BrainControler(bossBrain); this.bossControlerOne = new BrainControler(bossBrainOne); this.bossControlerTwo = new BrainControler(bossBrainTwo); this.InitialHero(); this.QueryControler(controler, hero); this.QueryControler(bossControler, boss); this.QueryControler1(bossControlerOne, bossOne); this.QueryControler2(bossControlerTwo, bossTwo); Application.Run(space); }
private void QueryControler2(IControlerable controler, WarUnit unit) { controler.MoveUp += (sender, args) => { MoveHeroToRight(unit); }; controler.MoveDown += (sender, args) => { MoveHeroDown(unit); }; controler.MoveToLeft += (sender, args) => { MoveHeroToRight(unit); }; controler.MoveToRight += (sender, args) => { MoveHeroUp(unit); }; controler.ThrowMagic += (sender, args) => { var magicArgs = args as CastEventArgs; HeroThrowMgic(magicArgs.mx, magicArgs.my); }; }