示例#1
0
        public GameStateManager(HiromiGame game, GameState initialState)
        {
            _game = game;
            _batch = new SpriteBatch(GraphicsService.Instance.GraphicsDevice);

            LoadState(initialState);
        }
示例#2
0
        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));
        }
示例#3
0
 public StateChangedMessage(GameState state)
 {
     this.State = state;
 }
示例#4
0
 public RequestChangeStateMessage(GameState state)
 {
     this.State = state;
 }