This class is specificaly used for the logic of network games
Inheritance: FBClient.Core.GameManager
Exemplo n.º 1
0
 public void SetGameManager(GameManager gameManager)
 {
     GameManager = (NetworkGameManager)gameManager;
     GameManager.Initialize();
 }
Exemplo n.º 2
0
        public override void Initialize()
        {
            HudOrigin = new Point(FinalBomber.Instance.GraphicsDevice.Viewport.Width - 234, 0);

            // Launch the dedicated server as host
            _serverProcess = new Process
            {
                StartInfo =
                {
                    FileName = "Server.exe",
                    Arguments = "COUCOU",
                    //WindowStyle = ProcessWindowStyle.Hidden
                }
            };

            //_serverProcess.Start();

            _gameManager = GameServer.Instance.GameManager;

            _gameManager.AddPlayers();

            base.Initialize();

            // Server events
            GameServer.Instance.End += GameServer_End;

            HudOrigin = new Point(GraphicsDevice.Viewport.Width - 234, 0);
            HudTopSpace = 15;
            HudMarginLeft = 15;

            ScoresWindowBox = new WindowBox(WindowSkin, new Vector2(HudOrigin.X, HudOrigin.Y),
                                             new Point(GraphicsDevice.Viewport.Width - (HudOrigin.X),
                                             HudTopSpace + _gameManager.Players.Count * Config.HUDPlayerInfoSpace + 15));

            TimerWindowBox = new WindowBox(WindowSkin, new Vector2(HudOrigin.X, ScoresWindowBox.Size.Y),
                new Point(GraphicsDevice.Viewport.Width - HudOrigin.X, 40));

            _gameManager.NetworkManager.AddPlayer += ResizeHud;
        }
Exemplo n.º 3
0
 public void SetGameManager(GameManager gameManager)
 {
     GameManager = (NetworkGameManager)gameManager;
     GameManager.Initialize();
 }