| 195 | } |
| 196 | |
| 197 | void EntityMap::forEachEntityAtTile(Vec2I const& pos, EntityCallbackOf<TileEntity> const& callback) const { |
| 198 | RectF rect(Vec2F(pos[0], pos[1]), Vec2F(pos[0] + 1, pos[1] + 1)); |
| 199 | forEachEntity(rect, [&](EntityPtr const& entity) { |
| 200 | if (auto tileEntity = as<TileEntity>(entity)) { |
| 201 | for (Vec2I space : tileEntity->spaces()) { |
| 202 | if (m_geometry.equal(pos, space + tileEntity->tilePosition())) |
| 203 | callback(tileEntity); |
| 204 | } |
| 205 | } |
| 206 | }); |
| 207 | } |
| 208 | |
| 209 | void EntityMap::forAllEntities(EntityCallback const& callback, function<bool(EntityPtr const&, EntityPtr const&)> sortOrder) const { |
| 210 | // Even if there is no sort order, we still copy pointers to a temporary |
nothing calls this directly
no test coverage detected