MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / entitiesAt

Method entitiesAt

source/game/StarEntityMap.cpp:168–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168List<EntityPtr> EntityMap::entitiesAt(Vec2F const& pos, EntityFilter const& filter) const {
169 auto entityList = entityQuery(RectF::withCenter(pos, {0, 0}), filter);
170
171 sortByComputedValue(entityList, [&](EntityPtr const& entity) -> float {
172 return vmagSquared(entity->position() - pos);
173 });
174 return entityList;
175}
176
177List<TileEntityPtr> EntityMap::entitiesAtTile(Vec2I const& pos, EntityFilterOf<TileEntity> const& filter) const {
178 List<TileEntityPtr> values;

Callers

nothing calls this directly

Calls 4

entityQueryFunction · 0.85
sortByComputedValueFunction · 0.85
vmagSquaredFunction · 0.85
positionMethod · 0.45

Tested by

no test coverage detected