public GameStateManager(HiromiGame game, GameState initialState) { _game = game; _batch = new SpriteBatch(GraphicsService.Instance.GraphicsDevice); LoadState(initialState); }
public void LoadState(GameState newState) { _currentState = newState; _currentState.Load(); _currentState.MessageManager.AddListener<RequestChangeStateMessage>(OnRequestChangeState); _currentState.MessageManager.AddListener<DisableAdsMessage>(OnDisableAds); _currentState.MessageManager.AddListener<EnableAdsMessage>(OnEnableAds); _currentState.MessageManager.QueueMessage(new StateChangedMessage(_currentState)); }
public StateChangedMessage(GameState state) { this.State = state; }
public RequestChangeStateMessage(GameState state) { this.State = state; }