internal bool RemoveCurrentNodefromList() { int currentNodeValue = CurrentServiceRequestInProgress.Value; LinkedListNode <int> temp = CurrentServiceRequestInProgress.Next; ServiceRequestList.Remove(currentNodeValue); CurrentServiceRequestInProgress = temp; return(true); }
private bool GetNextDestinationFloorToService(out int destinationFloor) { bool IsRequestPending = false; destinationFloor = 0; if (ServiceRequestList.Any() && ServiceRequestList.Count > 0) { if (CurrentServiceRequestInProgress == null) { CurrentServiceRequestInProgress = ServiceRequestList.First; } else if (CurrentServiceRequestInProgress != null) { VerifyCurrentNodeAndCarPosition(); } destinationFloor = CurrentServiceRequestInProgress.Value; IsRequestPending = true; } return(IsRequestPending); }