assignContinents

fun assignContinents(mode: TileMap.AssignContinentsMode)

Set a continent id for each tile, so we can quickly see which tiles are connected. Can also be called on saved maps.

Return

A map of continent sizes (continent ID to tile count)

Parameters

mode

As follows: Assign = initial assign, throw if tiles have continents. Reassign = clear continent data and redo for map editor. Ensure = regenerate continent sizes from tile data, and if that is empty, Assign.

Throws

when mode==Assign and any land tile already has a continent ID

Sources

jvm source
Link copied to clipboard