Beispiel #1
0
        public StateExit <STATE_ID> AddTestExit(StateTest test)
        {
            int exit = exits.Count;

            exits.Add(new KeyValuePair <StateTest, int>(test, exit));
            return(new StateExit <STATE_ID>(this, exit));
        }
Beispiel #2
0
        public override void Enter()
        {
            for (int i = 0; i < exits.Count; ++i)
            {
                StateTest test       = exits[i].Key;
                bool      testResult = test.Test();
                if (testResult)
                {
                    DoExitState(exits[i].Value);
                    return;
                }
            }

            DoExitState(defaultExitId);
        }