Exemple #1
0
        public CGameServer() : base()
        {
            m_DBConnection = new LocalDatabaseConnection();

            //m_MapManager = new MapManager();
            players = new List <PlayerAvatar>();

            m_ConnectionManager = new GameConnectionManager();
            //Create queue for waiting on entering players
            m_WaitQueue = new List <WaitingConnectionRequest>();
        }
        private void ConnectionPollTimer_Tick(object sender, EventArgs e)
        {
            GameConnectionManager.Poll();

            List <ConnectionForm> FormsCopy = new List <ConnectionForm>(ConnectionForms);

            foreach (ConnectionForm OldForm in FormsCopy)
            {
                if (OldForm.IsDisposed)
                {
                    ConnectionForms.Remove(OldForm);
                }
            }


            RefreshConnectionList();
        }
        public OutOfGameMenu(GameConnectionManager connectionManager, ConnectScreen connectScreen)
        {
            _connectionManager = connectionManager;
            _connectScreen = connectScreen;

            _startGameButton = new Button
            {
                Top = Property.Get(20f),
                Left = Property.Get(20f),
                Text = Property.Get("Start Game"),
            };
            _startGameButton.Click += OnStartGameButtonClick;

            _connectButton = new Button
            {
                Top = Property.Get(20f),
                Left = Property.Get(2 * 20f + Button.Width),
                Text = Property.Get("Connect"),
            };
            _connectButton.Click += () => _activeScreen = connectScreen;
        }
Exemple #4
0
        public OutOfGameMenu(GameConnectionManager connectionManager, ConnectScreen connectScreen)
        {
            _connectionManager = connectionManager;
            _connectScreen     = connectScreen;

            _startGameButton = new Button
            {
                Top  = Property.Get(20f),
                Left = Property.Get(20f),
                Text = Property.Get("Start Game"),
            };
            _startGameButton.Click += OnStartGameButtonClick;

            _connectButton = new Button
            {
                Top  = Property.Get(20f),
                Left = Property.Get(2 * 20f + Button.Width),
                Text = Property.Get("Connect"),
            };
            _connectButton.Click += () => _activeScreen = connectScreen;
        }
Exemple #5
0
        public PauseMenu(GameConnectionManager connectionManager)
        {
            _connectionManager = connectionManager;

            _backgroundOpacity = new AnimatedProperty
            {
                TargetValue    = DelegateProperty.Get(() => IsVisible ? 0.75f : 0f),
                AnimationSpeed = Property.Get(8f),
            };

            var buttonLeft = new AnimatedProperty(-Button.Width - 1)
            {
                TargetValue    = DelegateProperty.Get(() => IsVisible ? 25f : -Button.Width - 1),
                AnimationSpeed = Property.Get(16 * Button.Width),
            };

            _continueButton = new Button
            {
                Text = Property.Get("Continue"),
                Left = buttonLeft,
                Top  = Property.Get(60f),
            };

            _disconnectButton = new Button
            {
                Text = Property.Get("Disconnect"),
                Left = buttonLeft,
                Top  = Property.Get(100f),
            };

            _continueButton.Click += () =>
            {
                IsVisible = false;
            };

            _disconnectButton.Click += () =>
            {
                _connectionManager.Disconnect();
            };
        }
Exemple #6
0
        public PauseMenu(GameConnectionManager connectionManager)
        {
            _connectionManager = connectionManager;

            _backgroundOpacity = new AnimatedProperty
            {
                TargetValue = DelegateProperty.Get(() => IsVisible ? 0.75f : 0f),
                AnimationSpeed = Property.Get(8f),
            };

            var buttonLeft = new AnimatedProperty(-Button.Width - 1)
            {
                TargetValue = DelegateProperty.Get(() => IsVisible ? 25f : -Button.Width - 1),
                AnimationSpeed = Property.Get(16 * Button.Width),
            };

            _continueButton = new Button
            {
                Text = Property.Get("Continue"),
                Left = buttonLeft,
                Top = Property.Get(60f),
            };

            _disconnectButton = new Button
            {
                Text = Property.Get("Disconnect"),
                Left = buttonLeft,
                Top = Property.Get(100f),
            };

            _continueButton.Click += () =>
            {
                IsVisible = false;
            };

            _disconnectButton.Click += () =>
            {
                _connectionManager.Disconnect();
            };
        }
Exemple #7
0
 public MainMenu(GameConnectionManager connectionManager, OutOfGameMenu outOfGameMenu, PauseMenu pauseMenu)
 {
     _connectionManager = connectionManager;
     _outOfGameMenu = outOfGameMenu;
     _pauseMenu = pauseMenu;
 }
Exemple #8
0
 public MainMenu(GameConnectionManager connectionManager, OutOfGameMenu outOfGameMenu, PauseMenu pauseMenu)
 {
     _connectionManager = connectionManager;
     _outOfGameMenu     = outOfGameMenu;
     _pauseMenu         = pauseMenu;
 }
 public ConnectScreen(GameConnectionManager connectionManager)
 {
     _connectionManager = connectionManager;
 }
Exemple #10
0
 public ConnectScreen(GameConnectionManager connectionManager)
 {
     _connectionManager = connectionManager;
 }