예제 #1
0
 public async Task <ActionResult <MoveResponseDto> > Move([FromBody] MoveRequestDto moveDto)
 {
     if (await _roverService.MoveSequence(moveDto.Path))
     {
         return(Ok(new MoveResponseDto {
             RoverResponse = $"Rover moved successfully. New Position: {_roverService.Position.Item1},{_roverService.Position.Item2} Direction: {_roverService.Compass.ToString()}"
         }));
     }
     return(Ok(new MoveResponseDto {
         RoverResponse = $"Rover encountered an obstacle. New Position: {_roverService.Position.Item1},{_roverService.Position.Item2} Direction: {_roverService.Compass.ToString()}"
     }));
 }