예제 #1
0
        internal bool RemoveCurrentNodefromList()
        {
            int currentNodeValue      = CurrentServiceRequestInProgress.Value;
            LinkedListNode <int> temp = CurrentServiceRequestInProgress.Next;

            ServiceRequestList.Remove(currentNodeValue);
            CurrentServiceRequestInProgress = temp;

            return(true);
        }
예제 #2
0
        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);
        }