Пример #1
0
        public async Task RunBot(Log log)
        {
            var              active       = true;
            AI               ai           = new AI(log);
            RotarZairo       rotoZairo    = new RotarZairo(ai);
            Smokie           smokie       = new Smokie(ai);
            EclipseSouthGate eclipseSG    = new EclipseSouthGate(ai);
            EclipseLabyrinth eclipseL     = new EclipseLabyrinth(ai);
            Mastering        mastering    = new Mastering(ai);
            VocalWestGate    vocalWG      = new VocalWestGate(ai);
            VagabondWolf     vagabondWolf = new VagabondWolf(ai);
            Toad             toad         = new Toad(ai);
            VocalLabyrinth   VocalL       = new VocalLabyrinth(ai);
            DragonFly        dragonFly    = new DragonFly(ai);
            WoodGoblin       woodGoblin   = new WoodGoblin(ai);
            //toad
            //vagabond-wolf
            //dragon-fly
            //MonsterList monsterList = new MonsterList(
            //    //rotoZairo
            //    smokie
            //    );

            var monsterList = new List <Monster>()
            {
                smokie,
                eclipseSG,
                eclipseL,
                VocalL,
                mastering,
                vocalWG,
                rotoZairo,
                vagabondWolf,
                toad,
                woodGoblin,
                dragonFly
            };

            ScanMini scanMini = new ScanMini(ai, new OCR(), ai.Log);
            var      _hunt    = new Hunt(scanMini);
            var      mobs     = monsterList;//monsterList.GetMonsterList();

            while (active)
            {
                var nextMonster = await GetNextMonster(_hunt, mobs);

                bool arrived = await nextMonster.GoToLocation();

                if (arrived)
                {
                    await nextMonster.Hunt();
                }
                //await ScheduleHunt(_hunt, mobs);
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            var herd = new Animal[7];

            herd[0] = new Horse("Horse", 4, false);
            herd[1] = new Kangaroo("Kangaroo", 2, false);
            herd[2] = new Kangaroo("Kangaroo", 2, true);
            herd[3] = new DragonFly("DragonFly", 10, true);
            herd[4] = new Horse("Horse", 4, false);
            herd[5] = new Horse("Horse", 4, false);
            herd[6] = new Animal("Unknown", 2, true);
            var horse     = new Horse("Horse", 4, false);
            var kangoroo  = new Kangaroo("Kangoroo 3", 4, true);
            var dragonFly = new DragonFly("dragon 3", 6, true);

            foreach (var animal in herd)
            {
                Console.Write($"{animal.Name} ");
                animal.Voice();
            }
            horse.Voice();
            kangoroo.Voice();
            dragonFly.Voice();
            // Move method is called
            foreach (var animal in herd)
            {
                Console.Write($"{animal.Name} ");
                animal.Move();
            }
            horse.Move();
            kangoroo.Move();
            dragonFly.Move();
            foreach (var animal in herd)
            {
                Console.Write($"{animal.Name} ");
                animal.IsHungry();
            }
            horse.IsHungry();
            kangoroo.IsHungry();
            dragonFly.IsHungry();
        }