Beispiel #1
0
        public static Rover CreateRover(string initialState)
        {
            var states            = initialState.Split(":");
            var x                 = int.Parse(states[0]);
            var y                 = int.Parse(states[1]);
            var position          = new Position(x, y);
            var directionAsString = states[2];
            var direction         = DirectionFactory.CreateDirection(directionAsString);

            return(new Rover(position, direction));
        }
Beispiel #2
0
        private IDirection GetDirection(string direction)
        {
            IDirection roverDirection = DirectionFactory.CreateDirection(direction[0]);

            return(roverDirection);
        }