Esempio n. 1
0
 public GameState(Microsoft.Xna.Framework.Game game, GameStateManager manager)
     : base(game)
 {
     StateManager = manager;
     _childComponents = new List<GameComponent>();
     _tag = this;
 }
        public void ChangeState(GameState state)
        {
            while (_gameStates.Count > 0)
                RemoveState();

            state.DrawOrder = StartDrawOrder;
            _drawOrder = StartDrawOrder;
            AddState(state);
            OnStateChange();
        }
 public void PushState(GameState state)
 {
     _drawOrder += DrawOrderInc;
     state.DrawOrder = _drawOrder;
     AddState(state);
     OnStateChange();
 }
 private void AddState(GameState state)
 {
     _gameStates.Push(state);
     Game.Components.Add(state);
     StateChange += state.StateChange;
 }