| 15 | namespace Dungeon { |
| 16 | |
| 17 | bool TMXMap::forEachTile(TileCallback const& callback) const { |
| 18 | for (auto const& layer : tileLayers()) { |
| 19 | if (layer->forEachTile(this, callback)) |
| 20 | return true; |
| 21 | } |
| 22 | |
| 23 | for (auto const& group : objectGroups()) { |
| 24 | if (group->forEachTile(this, callback)) |
| 25 | return true; |
| 26 | } |
| 27 | |
| 28 | return false; |
| 29 | } |
| 30 | |
| 31 | bool TMXTileLayer::forEachTile(TMXMap const* map, TileCallback const& callback) const { |
| 32 | auto const& tilesets = map->tilesets(); |