TileSet
Bases: Iterable[Tile]
A tile set is an iterable that yields a tile for each coordinates in the grid by calling the tile fetcher.
Example
Assume the grid and the tile fetcher are already created.
You can create a tile set and iterate over the tiles.
tile_set = TileSet(
grid=grid,
tile_fetcher=tile_fetcher,
)
for tile in tile_set:
...
| PARAMETER | DESCRIPTION |
|---|---|
grid
|
Grid
TYPE:
|
tile_fetcher
|
Tile fetcher
TYPE:
|
__len__
Computes the number of tiles.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Number of tiles |
__getitem__
Returns the tile.
| PARAMETER | DESCRIPTION |
|---|---|
index
|
Index of the tile
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tile
|
Tile |