private static IFloorLobbyButton GetDownButton(int floorID)
        {
            ButtonFactory     btnFactory = new ButtonFactory();
            IFloorLobbyButton btn        = btnFactory.CreateButton(ButtonType.FloorButton) as IFloorLobbyButton;

            btn.ButtonID     = 0;
            btn.FloorID      = floorID;
            btn.IsDownButton = true;
            btn.ButtonName   = string.Format("Down Button at Floor {0}", floorID);
            return(btn);
        }
 public static AbstractFloorLobby CreateFloorLobby(FloorLobbyType floorLobbyType, int floorID)
 {
     if (floorLobbyType == FloorLobbyType.Top)
     {
         IFloorLobbyButton btn = GetDownButton(floorID);
         /* Dependency Injection using Constructor Injection*/
         return(new TopFloorLobby(btn));
     }
     else if (floorLobbyType == FloorLobbyType.Bottom)
     {
         IFloorLobbyButton btn = GetUpButton(floorID);
         /* Dependency Injection using Constructor Injection*/
         return(new BottomFloorLobby(btn));
     }
     else
     {
         IFloorLobbyButton upBtn   = GetUpButton(floorID);
         IFloorLobbyButton downBtn = GetDownButton(floorID);
         /* Dependency Injection using Constructor Injection*/
         return(new FloorLobby(upBtn, downBtn));
     }
 }
Ejemplo n.º 3
0
 /* Dependency Injection using Constructor Injection*/
 public BottomFloorLobby(IFloorLobbyButton btn)
 {
     FloorLobbyType = FloorLobbyType.Bottom;
     UpButton       = btn;
 }
Ejemplo n.º 4
0
 /* Dependency Injection using Constructor Injection*/
 public TopFloorLobby(IFloorLobbyButton btn)
 {
     FloorLobbyType = FloorLobbyType.Top;
     DownButton     = btn;
 }
Ejemplo n.º 5
0
 /* Dependency Injection using Constructor Injection*/
 public FloorLobby(IFloorLobbyButton upBtn, IFloorLobbyButton downBtn)
 {
     FloorLobbyType = FloorLobbyType.Normal;
     UpButton       = upBtn;
     DownButton     = downBtn;
 }
Ejemplo n.º 6
0
        private void FloorLobby_ButtonPressed(IButton btn, ButtonEventArgs btnEventArgs)
        {
            IFloorLobbyButton flButton = (IFloorLobbyButton)btn;

            ProcessRequest(flButton.FloorID);
        }