Example #1
0
        public IStateStackState <T> Pop()
        {
            IStateStackState <T> state = states[states.Count - 1];

            states.Remove(state);
            state.Exit();
            return(state);
        }
Example #2
0
        public override void Update(float dt)
        {
            for (int i = states.Count - 1; i >= 0; i--)
            {
                IStateStackState <T> state = states[i];
                state.Update(dt);
                bool isBlock = state.IsBlock();
                if (isBlock)
                {
                    break;
                }
            }

            if (states.Count == 0)
            {
                return;
            }
        }
Example #3
0
 public void Push(IStateStackState <T> state, T context)
 {
     states.Add(state);
     state.Enter(context);
 }