Ejemplo n.º 1
0
        public void Rover_CommandTest(int x, int y, string direction)
        {
            Rover rover = new Rover(_plateau, x, y, direction);


            rover.Command('L');

            Assert.True(rover.CurrentCoordinate.Direction == EnumDirection.W);
        }
Ejemplo n.º 2
0
        public static string Run(this Input input, IPlateau plateau)
        {
            Rover rover = new Rover(plateau);

            rover.Relocation(input.Coordinates);

            foreach (var command in input.Directions)
            {
                rover.Command(command);
            }

            return($"{rover}");
        }
Ejemplo n.º 3
0
        public static List <Rover> Run(this List <Input> roverList, IPlateau plateau)
        {
            List <Rover> returnList = new List <Rover>();

            foreach (var item in roverList)
            {
                Rover rover = new Rover(plateau);

                rover.Relocation(item.Coordinates);

                foreach (var command in item.Directions)
                {
                    rover.Command(command);
                }

                returnList.Add(rover);
            }

            return(returnList);
        }