예제 #1
0
파일: TheLift.cs 프로젝트: pasha9797/House
        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);
        }
예제 #2
0
파일: TheLift.cs 프로젝트: pasha9797/House
        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);
            }
        }