示例#1
0
 static void DisplayFloors(IBuilding building)
 {
     foreach (IFloor floor in building.GetFloors())
     {
         Console.WriteLine("Floor Id : {0} ", floor.FloorId.ToString());
     }
 }
示例#2
0
 private void displayFloorInfo(IBuilding building)
 {
     labelFloorsInfo.Text = "";
     foreach (IFloor floor in building.GetFloors())
     {
         labelFloorsInfo.Text = labelFloorsInfo.Text + Environment.NewLine + "Floor Id : " + floor.FloorId.ToString();
     }
 }
示例#3
0
        static int PressButtonFromAFloor(IBuilding building, int floorId, Direction direction)
        {
            IFloor floor  = building.GetFloors().Find(X => X.FloorId == floorId);
            int    result = 0;

            if (direction == Direction.UP)
            {
                result = floor.UpButton.Press(floor, building.GetElevators());
            }
            else
            {
                result = floor.DownButton.Press(floor, building.GetElevators());
            }

            return(result);
        }