コード例 #1
0
        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);
        }
コード例 #2
0
 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));
     }
 }
コード例 #3
0
 /* Dependency Injection using Constructor Injection*/
 public BottomFloorLobby(IFloorLobbyButton btn)
 {
     FloorLobbyType = FloorLobbyType.Bottom;
     UpButton       = btn;
 }
コード例 #4
0
 /* Dependency Injection using Constructor Injection*/
 public TopFloorLobby(IFloorLobbyButton btn)
 {
     FloorLobbyType = FloorLobbyType.Top;
     DownButton     = btn;
 }
コード例 #5
0
 /* Dependency Injection using Constructor Injection*/
 public FloorLobby(IFloorLobbyButton upBtn, IFloorLobbyButton downBtn)
 {
     FloorLobbyType = FloorLobbyType.Normal;
     UpButton       = upBtn;
     DownButton     = downBtn;
 }
コード例 #6
0
        private void FloorLobby_ButtonPressed(IButton btn, ButtonEventArgs btnEventArgs)
        {
            IFloorLobbyButton flButton = (IFloorLobbyButton)btn;

            ProcessRequest(flButton.FloorID);
        }