count method

int count()

Implementation

int count() {
  final driver = Query.chooseDriver(_withStores);
  var matches = 0;
  _world.beginQuery(this);
  try {
    for (var i = 0; i < driver.length; i++) {
      final entityIndex = driver.entityIndexAt(i);
      if (Query.passesFilters(entityIndex, _withStores, _withoutStores)) {
        matches++;
      }
    }
    return matches;
  } finally {
    _world.endQuery();
  }
}