private void CheckActiveRequests() { if (_liftCallCommands.Count == 0) { _currentDirectionType = DirectionType.None; UpdateLiftState(true); return; } var sameDirectionRequest = _liftCallCommands.FirstOrDefault(p => p.Direction == _currentDirectionType && IsFloorOnTheSameDirection(p.Floor)); if (sameDirectionRequest != null) { MoveLift(); } else { var sameDirectionFloor = _liftCallCommands.FirstOrDefault(p => IsFloorOnTheSameDirection(p.Floor)); if (sameDirectionFloor != null) { MoveLift(); } else { _currentDirectionType = _currentDirectionType.OppositeDirections(); MoveLift(); } } }