Exemple #1
0
        private void GetOut(int curFloor)
        {
            //playSound("ding.wav");
            StopLiftForNotLong();
            int i = 0;

            while (i < passengers.Count())
            {
                TheResident resident = passengers[i];
                if (resident.WantsTo == curFloor)
                {
                    passengers.Remove(resident);
                    if (resident.WantsTo == 1)
                    {
                        resident.SetOutdoorCoords();
                    }
                    else
                    {
                        resident.SetHomeCoords();
                    }
                }
                else
                {
                    i++;
                }
            }
            pressedInside.Remove(curFloor);
        }
Exemple #2
0
        private void GatherFloor(int curFloor)
        {
            playSound("ding.wav");
            StopLiftForNotLong();
            int i = passengers.Count();

            while (i < Settings.LiftCapacity && Program.mainForm.House.Floors[curFloor - 1].Waiting.Count() > 0)
            {
                TheResident resident = Program.mainForm.House.Floors[curFloor - 1].Waiting.Dequeue();
                passengers.Add(resident);
                resident.SetLiftCoords(i, curFloor);
                PressInsideButton(resident.WantsTo);
                i++;
            }
            if (Program.mainForm.House.Floors[curFloor - 1].Waiting.Count() == 0)
            {
                pressedButton.Remove(curFloor);
            }
        }