コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }