Example #1
0
        private Game()
        {
            Configuration = new GameConfigurationManager();
            DRAW_AFTER = Configuration.gameConfig.DRAW_INTERVAL / Configuration.gameConfig.UPDATE_INTERVAL;
            _drawFPS = 1000 / Configuration.gameConfig.DRAW_INTERVAL;
            _gameLoop = new HighFrequencyTimer(1000 / Configuration.gameConfig.UPDATE_INTERVAL, id => Update(id), () => { }, () => { }, (fps) =>
            {
                _actualFPS = fps;
            });
            _leaderboardLoop = new Timer(UpdateLeaderboard, null, Configuration.gameConfig.LEADERBOARD_PUSH_INTERVAL, Configuration.gameConfig.LEADERBOARD_PUSH_INTERVAL);

            _gameTime = new GameTime();
            _space = new Map();
            GameHandler = new GameHandler(_space);
            _payloadManager = new PayloadManager();

            UserHandler = new UserHandler(GameHandler);
            Leaderboard = new Leaderboard(UserHandler);
            ConnectionManager = new ConnectionManager(UserHandler, _locker);

            RegistrationHandler = new RegistrationHandler();
            RuntimeConfiguration = new RuntimeConfiguration();

            _gameLoop.Start();
        }
Example #2
0
        private Game()
        {
            Configuration = new GameConfigurationManager();
            DRAW_AFTER = TimeSpan.FromMilliseconds(Configuration.gameConfig.DRAW_INTERVAL);
            _gameLoop = new HighFrequencyTimer(1000 / Configuration.gameConfig.UPDATE_INTERVAL, id => Update(id));
            _leaderboardLoop = new Timer(UpdateLeaderboard, null, Configuration.gameConfig.LEADERBOARD_PUSH_INTERVAL, Configuration.gameConfig.LEADERBOARD_PUSH_INTERVAL);

            _gameTime = new GameTime();
            _space = new Map();
            GameHandler = new GameHandler(_space);
            _payloadManager = new PayloadManager();

            UserHandler = new UserHandler(GameHandler);
            Leaderboard = new Leaderboard(UserHandler);
            ConnectionManager = new ConnectionManager(UserHandler, _locker);

            RegistrationHandler = new RegistrationHandler();
            RuntimeConfiguration = new RuntimeConfiguration();

            _gameLoop.Start();
        }
Example #3
0
 public RespawnManager(GameHandler gameHandler)
 {
     _respawningShips = new List<KeyValuePair<Ship, DateTime>>();
     _gameHandler = gameHandler;
      _gen = new Random();
 }
Example #4
0
 public ShipManager(GameHandler gameHandler)
 {
     Ships = new ConcurrentDictionary<string, Ship>();
     _gameHandler = gameHandler;
     _respawnManager = new RespawnManager(_gameHandler);
 }
Example #5
0
 public UserHandler(GameHandler gameHandler)
 {
     _userList = new ConcurrentDictionary<string, User>();
     _gameHandler = gameHandler;
     TotalActiveUsers = 0;
 }
Example #6
0
 public ShipManager(GameHandler gameHandler)
 {
     Ships           = new ConcurrentDictionary <string, Ship>();
     _gameHandler    = gameHandler;
     _respawnManager = new RespawnManager(_gameHandler);
 }
Example #7
0
 public UserHandler(GameHandler gameHandler)
 {
     _userList        = new ConcurrentDictionary <string, User>();
     _gameHandler     = gameHandler;
     TotalActiveUsers = 0;
 }
Example #8
0
 public UserHandler(GameHandler gameHandler)
 {
     _gameHandler = gameHandler;
 }