matchesAll method

bool matchesAll(
  1. Entity entity
)

Implementation

bool matchesAll(Entity entity) {
  if (all.isEmpty) return true;
  // If reverse, we want to make sure we contain NONE of the components
  // in all.
  if (reverse) {
    for (final t in all) {
      if (entity.hasComponent(t)) {
        return false;
      }
    }
  } else {
    for (final t in all) {
      if (!entity.hasComponent(t)) {
        return false;
      }
    }
  }

  return true;
}