execute method

  1. @override
bool execute(
  1. GameComponent comp,
  2. BonfireGameInterface game
)
override

Implementation

@override
bool execute(GameComponent comp, BonfireGameInterface game) {
  if (comp is Vision) {
    bool see = false;
    comp.seeComponentType<T>(
      radiusVision: radiusVision,
      visionAngle: visionAngle,
      angle: angle,
      observed: (c) {
        observed?.call(c);
        return see = true;
      },
    );
    return see;
  } else {
    return false;
  }
}