Beispiel #1
0
 private List<LiftButton> CreateFloorButtons(int numberOfFloors)
 {
     var liftButtons = new List<LiftButton>();
     for (int i = 1; i <= numberOfFloors; i++)
     {
         var button = new LiftButton(this) { Number = i };
         liftButtons.Add(button);
     }
     return liftButtons;
 }
Beispiel #2
0
 public Lift(int liftNumber, int numberOfFloorButtons)
 {
     Number = liftNumber;
     EmergencyCallButton = new LiftButton(this);
     EmergencyExitButton = new LiftButton(this);
     OpenDoorButton = new OpenDoorButton(this);
     CloseDoorButton = new CloseDoorButton(this);
     FloorButtonList = CreateFloorButtons(numberOfFloorButtons);
     Controller = new LiftController(this);
 }