Ejemplo n.º 1
0
        public void PushState(GameState newState)
        {
            drawOrder += drawOrderInc;
            newState.DrawOrder = drawOrder;

            AddState(newState);

            if (OnStateChange != null)
            {
                OnStateChange(this, EventArgs.Empty);
            }
        }
Ejemplo n.º 2
0
 private void AddState(GameState newState)
 {
     GameStates.Push(newState);
     Game.Components.Add(newState);
     OnStateChange += newState.StateChange;
 }
Ejemplo n.º 3
0
        public void ChangeState(GameState newState)
        {
            while (GameStates.Count > 0)
            {
                RemoveState();
            }

            newState.DrawOrder = startDrawOrder;
            drawOrder = startDrawOrder;

            AddState(newState);

            if (OnStateChange != null)
            {
                OnStateChange(this, EventArgs.Empty);
            }
        }