| 91 | } |
| 92 | |
| 93 | bool TMXMap::forEachTileAt(Vec2I pos, TileCallback const& callback) const { |
| 94 | for (auto const& layer : tileLayers()) { |
| 95 | if (layer->forEachTileAt(pos, this, callback)) |
| 96 | return true; |
| 97 | } |
| 98 | |
| 99 | for (auto const& group : objectGroups()) { |
| 100 | if (group->forEachTileAt(pos, this, callback)) |
| 101 | return true; |
| 102 | } |
| 103 | |
| 104 | return false; |
| 105 | } |
| 106 | |
| 107 | bool TMXTileLayer::forEachTileAt(Vec2I pos, TMXMap const* map, TileCallback const& callback) const { |
| 108 | Vec2I tilePos(pos.x(), map->height() - 1 - pos.y()); |