Expand description
Grid geometry: positions, the four directions, a rectangular grid and sets of its tiles, and the terrain a tile is.
Structs§
- Grid
- A
width × heightrectangle of cells, stored row-major. The cell count always equalswidth * height; deserialising checks it. - Grid
Size Error - A saved grid whose cell count is not
width * height. - Pos
- A tile position. Signed so neighbour maths can go negative before bounds
checks;
(0, 0)is the top-left tile,xgrows right,ygrows down. - Terrain
Id - A terrain: its index in the game’s table of terrains. The engine knows
no terrain of its own; a game’s map is a
Gridof these, and its skins look each one up in the game’s table. - TileSet
- A set of tiles of a
width × heightmap, stored as a bitset. Iterates in row-major order. Positions outside the map are never members.
Enums§
- Dir
- One of the four grid directions.