예제 #1
0
        public void TestRetreat()
        {
            using (var consoleOutput = new ConsoleOutput())
            {
                var state = new GameState(32, 32, int.MaxValue, 100, 25, 5, 1);
                var bot   = new MyBot();

                state.StartNewTurn();
                state.AddAnt(16, 15, 0);
                state.AddAnt(12, 16, 1);
                state.AddAnt(12, 15, 1);
                state.AddAnt(12, 17, 1);

                var initDist = state.EnemyAnts.Select(x => state.GetDistance(state.MyAnts[0], x)).ToList();

                bot.DoTurn(state);

                ApplyTurn(state, consoleOutput.GetOuput());
                consoleOutput.Clear();


                var finalDist = state.EnemyAnts.Select(x => state.GetDistance(state.MyAnts[0], x)).ToList();


                for (int i = 0; i < initDist.Count; i++)
                {
                    Assert.Greater(finalDist[i], initDist[i]);
                }
            }
        }