MapGenerator

class MapGenerator(ruleset: Ruleset)

Types

Companion
Link copied to clipboard
object Companion

Functions

applyHumidityAndTemperature
Link copied to clipboard
private fun applyHumidityAndTemperature(tileMap: TileMap)

MapParameters.tilesPerBiomeArea to set biomes size MapParameters.temperatureExtremeness to favor very high and very low temperatures

cellularHills
Link copied to clipboard
private fun cellularHills(tileMap: TileMap, mountain: String?, hill: String)
cellularMountainRanges
Link copied to clipboard
private fun cellularMountainRanges(tileMap: TileMap, mountain: String, hill: String?, flat: String)
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
generateMap
Link copied to clipboard
fun generateMap(mapParameters: MapParameters, civilizations: List<CivilizationInfo> = emptyList()): TileMap
hashCode
Link copied to clipboard
open fun hashCode(): Int
raiseMountainsAndHills
Link copied to clipboard
private fun raiseMountainsAndHills(tileMap: TileMap)

MapParameters.elevationExponent favors high elevation

runAndMeasure
Link copied to clipboard
private fun runAndMeasure(text: String, action: () -> Unit)
seedRNG
Link copied to clipboard
private fun seedRNG(seed: Long)
spawnIce
Link copied to clipboard
private fun spawnIce(tileMap: TileMap)
spawnLakesAndCoasts
Link copied to clipboard
private fun spawnLakesAndCoasts(map: TileMap)
spawnRareFeatures
Link copied to clipboard
private fun spawnRareFeatures(tileMap: TileMap)

MapParameters.rareFeaturesRichness is the probability of spawning a rare feature

spawnVegetation
Link copied to clipboard
private fun spawnVegetation(tileMap: TileMap)

MapParameters.vegetationRichness is the threshold for vegetation spawn

spreadAncientRuins
Link copied to clipboard
private fun spreadAncientRuins(map: TileMap)
spreadResources
Link copied to clipboard
private fun spreadResources(tileMap: TileMap)
private fun spreadResources(tileMap: TileMap, mapRadius: Int, resourceType: ResourceType)

Spreads resources of type resourceType picking locations at a minimum distance from each other, which is determined from mapRadius and then tuned down until the desired number fits. MapParameters.resourceRichness used to control how many resources to spawn.

spreadStrategicResources
Link copied to clipboard
private fun spreadStrategicResources(tileMap: TileMap, mapRadius: Int)
toString
Link copied to clipboard
open fun toString(): String

Properties

randomness
Link copied to clipboard
private var randomness: MapGenerationRandomness
ruleset
Link copied to clipboard
val ruleset: Ruleset

Sources

jvm source
Link copied to clipboard