placeResourcesInTiles

private fun placeResourcesInTiles(frequency: Int, tileList: List<TileInfo>, resourceOptions: List<TileResource>, baseImpact: Int = 0, randomImpact: Int = 0, majorDeposit: Boolean = false, forcePlacement: Boolean = false): Map<TileResource, Int>

Given a tileList and possible resourceOptions, will place a resource on every frequency tiles. Tries to avoid impacts, but falls back to lowest impact otherwise. Goes through the list in order, so pre-shuffle it! Assumes all tiles in the list are of the same terrain type when generating weightings, irrelevant if only one option. Respects terrainsCanBeFoundOn when there is only one option, unless forcePlacement is true.

Return

a map of the resources in the options list to number placed.

Sources

jvm source
Link copied to clipboard