Example #1
0
        private static RoverStartPositionCommand SetStartPositionCoordinates(string[] startPositionStringArray)
        {
            var gridXAndYLength           = new YAndXCoordinate();
            var roverStartPositionCommand = new RoverStartPositionCommand();

            gridXAndYLength.Y = int.Parse(startPositionStringArray[0]);
            gridXAndYLength.X = int.Parse(startPositionStringArray[1]);
            roverStartPositionCommand.GridPosition = gridXAndYLength;
            return(roverStartPositionCommand);
        }
Example #2
0
        public Guid CreateARover(YAndXCoordinate startingGridPosition, RoverStatus roverStatus,
                                 Direction roverStartDirection)
        {
            var result = new Entities.Rover
            {
                GridPosition         = startingGridPosition,
                RoverStatus          = roverStatus,
                RoverFacingDirection = roverStartDirection,
                RoverId = Guid.NewGuid()
            };

            _rovers.Add(result);
            return(result.RoverId);
        }