From 38c97e14926f4bc538c20b24f8a3decdef1668f9 Mon Sep 17 00:00:00 2001 From: glx22 Date: Wed, 12 May 2021 16:45:28 +0200 Subject: Codechange: Replace TILE_AREA_LOOP with range-based for loops --- src/tilearea.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/tilearea.cpp') diff --git a/src/tilearea.cpp b/src/tilearea.cpp index 84ac7a90f..21271f94f 100644 --- a/src/tilearea.cpp +++ b/src/tilearea.cpp @@ -146,6 +146,24 @@ void OrthogonalTileArea::ClampToMap() this->h = std::min(this->h, MapSizeY() - TileY(this->tile)); } +/** + * Returns an iterator to the beginning of the tile area. + * @return The OrthogonalTileIterator. + */ +OrthogonalTileIterator OrthogonalTileArea::begin() const +{ + return OrthogonalTileIterator(*this); +} + +/** + * Returns an iterator to the end of the tile area. + * @return The OrthogonalTileIterator. + */ +OrthogonalTileIterator OrthogonalTileArea::end() const +{ + return OrthogonalTileIterator(OrthogonalTileArea()); +} + /** * Create a diagonal tile area from two corners. * @param start First corner of the area. -- cgit v1.2.3-54-g00ecf