Engine > Managers > Map Manager

Manages map data as the single access point between GameState and the rest of the engine. All tile queries, neighbor lookups, edge tile access, and spatial operations should flow through here rather than touching state directly.

generate

Generates and stores the tile grid from settings. Called by initializers at the start of a new session in place of setting tiles directly on state.

getTileAt

Returns the tile at (x, y), or null if out of bounds or on a null cell.

getTileRing

Returns tiles in one or more rings around (x, y).

getTileRing(x, y, 3) - ring 3 only getTileRing(x, y, 3, 2) - rings 2 and 3 getTileRing(x, y, 3, 1) - rings 1, 2, and 3 getTileRing(x, y, 3, 0) - center tile + rings 1, 2, and 3

start is clamped to [0, ring]. Omitting it returns only the outer ring.

#getRing

Returns all tiles at exactly ring distance from (x, y) using cube coordinate math. Starts at the top-left position and walks clockwise. Called by getTileRing.

edgeTiles

Returns the set of tiles on the outer perimeter of the map.

#cacheEdgeTiles

Caches all tiles on the outer perimeter of the map. Used for bot spawn placement.

#cahceTileNeighbors

Order here matters and is explicit as it maps to the UI.TILE.NEIGHBORS mapping.




© Gamesanova 2026