示例#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();
        }
示例#2
0
文件: Game.cs 项目: EugeneWang/ShootR
        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();
        }
示例#3
0
文件: Game.cs 项目: AbhiLegend/ShootR
        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();
        }
示例#4
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();
        }
示例#5
0
        public Game(IHubContext <GameHub> gameHub)
        {
            Configuration = new GameConfigurationManager();

            _gameLoop = new HighFrequencyTimer(1000 / Configuration.gameConfig.UPDATE_INTERVAL, async id => await Update(id), () => { }, () => { }, (fps) =>
            {
                _actualFPS = fps;
            });
            _gameHub = gameHub;

            _leaderboardLoop = new Timer(UpdateLeaderboard, null, Configuration.gameConfig.LEADERBOARD_PUSH_INTERVAL, Configuration.gameConfig.LEADERBOARD_PUSH_INTERVAL);

            DRAW_AFTER        = Configuration.gameConfig.DRAW_INTERVAL / Configuration.gameConfig.UPDATE_INTERVAL;
            _gameTime         = new GameTime();
            _space            = new Map(this, gameHub);
            GameHandler       = new GameHandler(_space, this);
            _payloadManager   = new PayloadManager();
            UserHandler       = new UserHandler(GameHandler);
            Leaderboard       = new Leaderboard(UserHandler, gameHub);
            ConnectionManager = new ConnectionManager(UserHandler, _gameLock, gameHub);

            _gameLoop.Start();
        }