process method

  1. @override
bool process(
  1. double dt,
  2. GameComponent comp,
  3. BonfireGameInterface game
)
override

Processes this behavior for the current frame.

Returns true when the behavior is finished and the manager should advance to the next behavior, or false to keep running it on the next frame.

Implementation

@override
bool process(double dt, GameComponent comp, BonfireGameInterface game) {
  for (final behavior in behaviors) {
    if (!behavior.process(dt, comp, game)) {
      return false; // this child is active, keep running it
    }
  }
  return true; // no child is active, selector is finished
}