Codechange: Replace TILE_AREA_LOOP with range-based for loops

This commit is contained in:
glx22
2021-05-12 16:45:28 +02:00
committed by Loïc Guilloux
parent 5bd8144853
commit 38c97e1492
23 changed files with 101 additions and 76 deletions

View File

@@ -146,6 +146,24 @@ void OrthogonalTileArea::ClampToMap()
this->h = std::min<int>(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.