From: fredboy Date: Wed, 17 Apr 2024 12:34:44 +0000 (+0700) Subject: Fix world gen config X-Git-Tag: alpha0.5.0~2 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=55eff4ac8845da1b2fc92dcadf8b7a440fe122f7;p=cavedroid.git Fix world gen config --- diff --git a/core/src/ru/deadsoftware/cavedroid/game/model/world/generator/WorldGeneratorConfig.kt b/core/src/ru/deadsoftware/cavedroid/game/model/world/generator/WorldGeneratorConfig.kt index ea34209..19a7c2d 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/model/world/generator/WorldGeneratorConfig.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/model/world/generator/WorldGeneratorConfig.kt @@ -19,7 +19,7 @@ data class WorldGeneratorConfig( private const val DEFAULT_HEIGHT = 256 private const val DEFAULT_MIN_BIOME_SIZE = 64 - fun getDefaultWithSeed(): WorldGeneratorConfig { + fun getDefault(): WorldGeneratorConfig { return WorldGeneratorConfig( width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT, diff --git a/core/src/ru/deadsoftware/cavedroid/game/world/GameWorld.java b/core/src/ru/deadsoftware/cavedroid/game/world/GameWorld.java index b616424..31d842b 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/world/GameWorld.java +++ b/core/src/ru/deadsoftware/cavedroid/game/world/GameWorld.java @@ -1,7 +1,6 @@ package ru.deadsoftware.cavedroid.game.world; import com.badlogic.gdx.utils.Disposable; -import com.badlogic.gdx.utils.TimeUtils; import kotlin.Pair; import ru.deadsoftware.cavedroid.game.GameItems; import ru.deadsoftware.cavedroid.game.GameScope; @@ -14,14 +13,11 @@ import ru.deadsoftware.cavedroid.game.objects.DropController; import javax.annotation.CheckForNull; import javax.inject.Inject; -import java.sql.Time; import java.util.Timer; @GameScope public class GameWorld implements Disposable { - private static final int DEFAULT_WIDTH = 1024; - private static final int DEFAULT_HEIGHT = 256; private static final int UPDATE_RANGE = 16; private final DropController mDropController; @@ -50,9 +46,10 @@ public class GameWorld implements Disposable { boolean isNewGame = foreMap == null || backMap == null; if (isNewGame) { - mWidth = DEFAULT_WIDTH; - mHeight = DEFAULT_HEIGHT; - Pair maps = new GameWorldGenerator(WorldGeneratorConfig.Companion.getDefaultWithSeed()).generate(); + final WorldGeneratorConfig config = WorldGeneratorConfig.Companion.getDefault(); + mWidth = config.getWidth(); + mHeight = config.getHeight(); + Pair maps = new GameWorldGenerator(config).generate(); mForeMap = maps.getFirst(); mBackMap = maps.getSecond(); mMobsController.getPlayer().respawn(this);