tryAddingResourceToTiles

private fun tryAddingResourceToTiles(resource: TileResource, amount: Int, tiles: Sequence<TileInfo>, ratio: Float = 1f, respectImpacts: Boolean = false, baseImpact: Int = -1, randomImpact: Int = 0, majorDeposit: Boolean = false): Int

Attempts to place amount on tiles, checking tiles in order. A ratio below 1 means skipping some tiles, ie ratio = 0.25 will put a resource on every 4th eligible tile. Can optionally respect impact flags, and places impact if baseImpact>= 0. Returns number of placed resources.

Sources

jvm source
Link copied to clipboard