public void Act_Moves_Snake_In_Game()
        {
            var gameFactory = new CountdownGameFactory(10, 10);
            var router      = new Router();
            var controller  = new AIController(AIOptions.GetDefault(0), gameFactory, router);

            var startPos = controller.CurrentGame.Snake.GetHeadPosition();

            var result = controller.Act();

            var endPos = controller.CurrentGame.Snake.GetHeadPosition();

            Assert.AreNotEqual(startPos, endPos);
        }
Beispiel #2
0
        private static IEnumerable <IController> GetControllers(uint playerCount, uint aiCount, IGameFactory gameFactory,
                                                                IRouter router)
        {
            var result = new List <IController>();

            for (var i = 0; i < playerCount; i++)
            {
                result.Add(new PlayerController(PlayerOptions.GetDefault(i), gameFactory));
            }

            for (var i = 0; i < aiCount; i++)
            {
                result.Add(new AIController(AIOptions.GetDefault(i), gameFactory, router));
            }

            return(result);
        }
Beispiel #3
0
 public void Setup()
 {
     _controller = new AIController(AIOptions.GetDefault(0), new CountdownGameFactory(Bounds, Bounds), new Router());
 }