matchesAny method

bool matchesAny(
  1. Entity entity
)

Implementation

bool matchesAny(Entity entity) {
  if (any.isEmpty) return true;
  // If reversed, we match if it doesn't contain any of the any components
  if (reverse) {
    for (var t in any) {
      if (entity.hasComponent(t) == false) {
        return true;
      }
    }
  } else {
    for (var t in any) {
      if (entity.hasComponent(t)) {
        return true;
      }
    }
  }

  return false;
}