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

            StateStack.RemoveAt(0);
        }
示例#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();
            }
        }
示例#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;
        }
示例#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;
                }
            }
        }