Exemplo n.º 1
0
        private void GameLoop()
        {
            while (!CancellationToken.IsCancellationRequested)
            {
                Thread.Sleep(GameplayConstants.GameTicksPerSecond);
                _secretData++;
                _worldStateHandler.OnGameTick();

                if (_secretData >= GameplayConstants.InactiveTimeoutDuration * 60000 / GameplayConstants.GameTicksPerSecond)
                {
                    _entityManager.RemoveInactiveManagers();
                    _secretData = 0;
                }
            }
            GameStateUpdate?.Invoke(this, new GameStateUpdateEvent
            {
                GameState = $"Game Ending..."
            });
        }
Exemplo n.º 2
0
 private void informAboutUpdate()
 {
     OnGameStateUpdate.Invoke();
 }