Esempio n. 1
0
 public GameState(Game game, GameStateManager manager)
     : base(game)
 {
     StateManager = manager;
     childComponents = new List<GameComponent>();
     tag = this;
 }
Esempio n. 2
0
        protected GameState(Game game, GameStateManager manager)
            : base(game)
        {
            StateManager = manager;

            _childComponents = new List<GameComponent>();
            _tag = this;
        }
Esempio n. 3
0
 public void PushState(GameState newState)
 {
     drawOrder += drawOrderInc;
     newState.DrawOrder = drawOrder;
     AddState(newState);
     if (OnStateChange != null)
         OnStateChange(this, null);
 }
Esempio n. 4
0
 public void ChangeState(GameState newState)
 {
     while (gameStates.Count > 0)
         RemoveState();
     newState.DrawOrder = startDrawOrder;
     drawOrder = startDrawOrder;
     AddState(newState);
     if (OnStateChange != null)
         OnStateChange(this, null);
 }
Esempio n. 5
0
 private void AddState(GameState newState)
 {
     gameStates.Push(newState);
     Game.Components.Add(newState);
     OnStateChange += newState.StateChange;
 }