src/State.cpp
/*
 * Evals all transitions sequentially until one of them is true.
 * Returns:
 * The stateNumber of the transition that evaluates to true
 * -1 if none evaluate to true ===> Returning index now instead to avoid confusion between first run and no transitions
 */
Evals all transitions sequentially until one of them is true.
Returns:
The stateNumber of the transition that evaluates to true
-1 if none evaluate to true ===> Returning index now instead to avoid confusion between first run and no transitions
Evals all transitions sequentially until one of them is true . Returns : The stateNumber of the transition that evaluates to true - 1 if none evaluate to true === > Returning index now instead to avoid confusion between first run and no transitions
int State::evalTransitions(){
  if(transitions->size() == 0) return index;
  bool result = false;
  for(int i=0;i<transitions->size();i++){
    result = transitions->get(i)->conditionFunction();
    if(result == true){
      return transitions->get(i)->stateNumber;
    }
  }
  return index;
}
int State :: evalTransitions ( ) { if ( transitions -> size ( ) == 0 ) return index ; bool result = false ; for ( int i = 0 ; i < transitions -> size ( ) ; i ++ ) { result = transitions -> get ( i ) -> conditionFunction ( ) ; if ( result == true ) { return transitions -> get ( i ) -> stateNumber ; } } return index ; }
Evals all transitions sequentially until one of them is true.
Evals all transitions sequentially until one of them is true .