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)); }
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); }