From 3b642ffe401d94bd6111f48c0920b87c7e48d5a9 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 18 Apr 2024 17:55:10 +0700 Subject: [PATCH] Remove "withRandom" --- .../defs/world/TerrainSelectorParameters.kt | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/world/TerrainSelectorParameters.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/world/TerrainSelectorParameters.kt index fbf4f5de..434e1fa6 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/world/TerrainSelectorParameters.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/world/TerrainSelectorParameters.kt @@ -16,21 +16,9 @@ data class TerrainSelectorParameters( ) { fun withSeed(seed: Long) = copy(seed = seed) fun withCommonality(commonality: Double) = copy(commonality = commonality) - private var random: RandomGenerator? = null fun random(): RandomGenerator { - return random ?: ru.dbotthepony.kstarbound.util.random.random(seed) - } - - fun withRandom(): TerrainSelectorParameters { - if (random == null) - return withRandom(ru.dbotthepony.kstarbound.util.random.random(seed)) - - return this - } - - fun withRandom(randomGenerator: RandomGenerator): TerrainSelectorParameters { - return copy().also { it.random = randomGenerator } + return ru.dbotthepony.kstarbound.util.random.random(seed) } fun noiseAngle(x: Int): Pair {