예제 #1
0
 /// <summary>
 /// Tests this state's transitions
 /// </summary>
 protected virtual void EvaluateTransitions()
 {
     if (Transitions.Count == 0)
     {
         return;
     }
     for (int i = 0; i < Transitions.Count; i++)
     {
         if (Transitions[i].Decision != null)
         {
             if (Transitions[i].Decision.Decide())
             {
                 if (Transitions[i].TrueState != "")
                 {
                     _brain.TransitionToState(Transitions[i].TrueState);
                 }
             }
             else
             {
                 if (Transitions[i].FalseState != "")
                 {
                     _brain.TransitionToState(Transitions[i].FalseState);
                 }
             }
         }
     }
 }
예제 #2
0
 /// <summary>
 /// Tests this state's transitions
 /// </summary>
 public virtual void EvaluateTransitions()
 {
     if (Transitions.Count == 0)
     {
         return;
     }
     for (int i = 0; i < Transitions.Count; i++)
     {
         if (Transitions[i].Decision != null)
         {
             if (Transitions[i].Decision.Decide())
             {
                 if (!string.IsNullOrEmpty(Transitions[i].TrueState))
                 {
                     _brain.TransitionToState(Transitions[i].TrueState);
                 }
             }
             else
             {
                 if (!string.IsNullOrEmpty(Transitions[i].FalseState))
                 {
                     _brain.TransitionToState(Transitions[i].FalseState);
                 }
             }
         }
     }
 }