|
CorsixTH engine (the C++ part)
Open source implementation of Theme Hospital
|
Utility class for iterating over map tiles within a screen rectangle. More...
#include <th_map.h>
Public Member Functions | |
| map_tile_iterator ()=delete | |
| map_tile_iterator (const level_map *pMap, int iScreenX, int iScreenY, int iWidth, int iHeight, map_scanline_iterator_direction eScanlineDirection=map_scanline_iterator_direction::forward) | |
| operator bool () const | |
| Returns false if the iterator has exhausted its tiles. | |
| map_tile_iterator & | operator++ () |
| Advances the iterator to the next tile. | |
| const map_tile * | operator-> () const |
| Accessor for the current tile. | |
| int | tile_x_position_on_screen () const |
| int | tile_y_position_on_screen () const |
| int | tile_x () const |
| int | tile_y () const |
| const level_map * | get_map () |
| const map_tile * | get_map_tile () |
| int | get_scanline_count () |
| int | get_tile_step () |
| bool | is_last_on_scanline () const |
| Returns true if the next tile will be on a different scanline. | |
Friends | |
| class | map_scanline_iterator |
Utility class for iterating over map tiles within a screen rectangle.
To easily iterate over the map tiles which might draw something within a certain rectangle of screen space, an instance of this class can be used.
By default, it iterates by scanline, top-to-bottom, and then left-to-right within each scanline. Alternatively, by passing ScanlineBackward to the constructor, it will iterate bottom-to-top. Within a scanline, to visit tiles right-to-left, wait until isLastOnScanline() returns true, then use an instance of THMapScanlineIterator.
|
delete |
| map_tile_iterator::map_tile_iterator | ( | const level_map * | pMap, |
| int | iScreenX, | ||
| int | iScreenY, | ||
| int | iWidth, | ||
| int | iHeight, | ||
| map_scanline_iterator_direction | eScanlineDirection = map_scanline_iterator_direction::forward |
||
| ) |
|
inline |
|
inline |
|
inline |
Returns true if the next tile will be on a different scanline.
To visit a scanline in right-to-left order, or to revisit a scanline, wait until this method returns true, then use a THMapScanlineIterator.
|
inline |
Returns false if the iterator has exhausted its tiles.
|
inline |
Advances the iterator to the next tile.
|
inline |
|
inline |
Get the X position of the tile relative to the top-left corner of the screen-space rectangle
|
inline |
|
inline |
Get the Y position of the tile relative to the top-left corner of the screen-space rectangle
|
friend |