private void RequestFloor(int floor)
    {
        var direction      = floor > _currentFloor ? DirectionType.Up : DirectionType.Down;
        var currentRequest = new LiftCallCommand(floor, direction);

        CheckActiveRequests();

        Request(currentRequest, direction);
    }
    private void Request(LiftCallCommand liftCallCommand, DirectionType directionType)
    {
        _liftCallCommands.Add(liftCallCommand);

        if (_currentDirectionType == DirectionType.None)
        {
            _currentDirectionType = directionType;
            MoveLift();
        }
    }
示例#3
0
    private void CallTheLift(DirectionType directionRequest, Image buttonImage)
    {
        if (_directionRequest == DirectionType.None && _liftCurrentFloor != _floorNumber)
        {
            _directionRequest = directionRequest;
            buttonImage.color = _higlighedColor;

            var liftCallCommand = new LiftCallCommand(_floorNumber, _directionRequest);

            if (LiftCalled != null)
            {
                LiftCalled(liftCallCommand);
            }
        }
    }
示例#4
0
 private void RequestFloor(LiftCallCommand liftCallCommand)
 {
     _liftController.RequestFloor(liftCallCommand);
 }
    public void RequestFloor(LiftCallCommand liftCallCommand)
    {
        var direction = liftCallCommand.Floor > _currentFloor ? DirectionType.Up : DirectionType.Down;

        Request(liftCallCommand, direction);
    }