Exemplo n.º 1
0
        public override void Start()
        {
            ResetBotState();

            var config = this.GetGameConfig();

            if (config == null)
            {
                LogError("Wrong config.");
                TreeRoot.Stop();
                return;
            }


            var npcList = config.Npcs;

            Strategy = config.Strategy;

            if (npcList == null || npcList.Count == 0)
            {
                LogError("Wrong config. Npc isn't defined.");
                TreeRoot.Stop();
                return;
            }

            Random r         = new Random();
            int    npcIndexR = r.Next(0, 1000);
            int    npcIndex  = npcIndexR % npcList.Count;

            TargetNpc = npcList[npcIndex];

            gameWindow = new SimpleGameWindow(config.WindowName);

            Navigator.NavigationProvider = new ServiceNavigationProvider();
            Navigator.PlayerMover        = new SlideMover();

            Log("Starting.");
        }
Exemplo n.º 2
0
        public override void Start()
        {
            FinalizedPath     = null;
            findPathRequested = false;
            playCount         = 0;
            statistic.Reset();

            if (!availableConfigs.ContainsKey(SelectedGame))
            {
                TreeRoot.Stop();
                return;
            }

            var config  = availableConfigs[SelectedGame];
            var npcList = config.Npcs;

            Strategy = config.Strategy;

            if (npcList == null || npcList.Count == 0)
            {
                TreeRoot.Stop();
                return;
            }

            Random r         = new Random();
            int    npcIndexR = r.Next(0, 1000);
            int    npcIndex  = npcIndexR % npcList.Count;

            TargetNpc = npcList[npcIndex];

            gameWindow = new SimpleGameWindow(config.WindowName);

            Navigator.NavigationProvider = new ServiceNavigationProvider();
            Navigator.PlayerMover        = new SlideMover();

            Log("Starting.");
        }