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