public DroneResponse MoveRight(Coordinate coordinate) { try { if (ValidateMovementRange(coordinate.X)) { var command = ControlCommand.Right(coordinate.X); var response = MoveDrone(command); Thread.Sleep(base.CommandDelayList[DroneConstants.RIGHT]); return(response); } } catch (Exception ex) { Console.WriteLine(ex.Message); } return(DroneResponse.FAIL); }
public async Task <DroneResponse> MoveRightAsync(Coordinate coordinate) { try { if (ValidateMovementRange(coordinate.X)) { var command = ControlCommand.Right(coordinate.X); var response = await MoveDroneAsync(command); await Task.Delay(base.CommandDelayList[DroneConstants.RIGHT]); return(response); } } catch (Exception ex) { Console.WriteLine(ex.Message); } return(DroneResponse.FAIL); }