Esempio n. 1
0
        public void ChangeState(string stateID, params object[] passThrough)

        {
            StateInfo stateInfo = GetStateInfoByName(stateID);

            if (stateInfo != null)

            {
                _PopCount = _StateStack.Count;

                _NewPush = new ClassPassthrough(stateInfo, Peek(), passThrough);
            }

            else

            {
                throw new StateNotFoundException(string.Format("Cannot change to state {0}.  State not found!", stateID));
            }
        }
Esempio n. 2
0
        public void PriorityUpdate()

        {
            // remove all pops

            bool bFirst = true;

            while (_PopCount > 0)

            {
                PopState_Internal(bFirst);

                _PopCount--;

                bFirst = false;
            }



            // push the new

            if (_NewPush != null)

            {
                // doing this in case we push a new in enter/resume

                ClassPassthrough toState = _NewPush;

                _NewPush = null;

                PushState_Internal(toState);
            }



            StateInfo topState = Peek();

            if (topState != null)

            {
                _States[topState].PriorityUpdate();
            }
        }