Exemplo n.º 1
0
        public void RemoveHeadState()
        {
            if (StateStack.Count < 1)
            {
                throw new Exception("There are no more states to remove");
            }

            StateStack.RemoveAt(0);
        }
Exemplo n.º 2
0
        public void PopState()
        {
            if (StateStack.Count > 0)
            {
                StateStack.RemoveAt(0);
            }

            if (StateStack.Count > 0)
            {
                var state = StateStack.ElementAt(0);
                NextState = state;
                NextState.OnEnter();
            }
        }
Exemplo n.º 3
0
        public void PopState()
        {
            if (StateStack.Count < 1)
            {
                throw new Exception("There are no more states to pop");
            }

            var last = StateStack.Last();

            StateStack.RemoveAt(StateStack.Count - 1);

            Position = last.Position;
            Mode     = last.Mode;
        }
Exemplo n.º 4
0
        public void PopState()
        {
            if (StateStack.Count > 0)
            {
                StateStack.RemoveAt(0);
            }
            if (StateStack.Count > 0)
            {
                string state = StateStack.ElementAt(0);

                NextState = state;
                States[NextState].OnEnter();
                States[NextState].TransitionValue = 0.0f;
                States[NextState].Transitioning   = GameState.TransitionMode.Entering;

                if (CurrentState != "")
                {
                    States[CurrentState].Transitioning   = GameState.TransitionMode.Exiting;
                    States[CurrentState].TransitionValue = 0.0f;
                }
            }
        }