Esempio n. 1
0
        public void RoverCommander_Move()
        {
            var rover = _roverCommander.Plateau.Rovers[0];

            _roverCommander.Move(rover);

            Assert.AreEqual(1, rover.PositionX);
            Assert.AreEqual(3, rover.PositionY);
            Assert.AreEqual(Directions.N, rover.Direction);
        }
Esempio n. 2
0
 private void Move(int player, GameField field, ICommander commander)
 {
     foreach (Point point in field.Iterator())
     {
         Direction dir = (Direction)random.Next(1, 7);
         int robot = random.Next(field[point].ActiveRobot) + 1;
         if (field.IsMove(point, dir, robot))
         {
             commander.Move(point.X, point.Y, dir, robot);
         }
     }
 }