get method

bool get(
  1. Entity entity,
  2. Query4Callback<A, B, C, D> found
)

Implementation

bool get(Entity entity, Query4Callback<A, B, C, D> found) {
  if (!_world.isAlive(entity)) return false;
  final entityIndex = entity.index;
  final aDense = _a.denseIndexOf(entityIndex);
  if (aDense < 0) return false;
  final bDense = _b.denseIndexOf(entityIndex);
  if (bDense < 0) return false;
  final cDense = _c.denseIndexOf(entityIndex);
  if (cDense < 0) return false;
  final dDense = _d.denseIndexOf(entityIndex);
  if (dDense < 0) return false;
  if (!Query.passesFilters(entityIndex, _withStores, _withoutStores)) {
    return false;
  }
  found(
    entity,
    _a.valueAt(aDense),
    _b.valueAt(bDense),
    _c.valueAt(cDense),
    _d.valueAt(dDense),
  );
  return true;
}