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