From ba9bb4a56b1182a5b20aa070aa717a4b681b1a02 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Mon, 30 Dec 2024 11:47:28 +0200 Subject: [PATCH] chore: remove dead loadScenario function (happens via new game screen) --- core/src/com/unciv/logic/files/UncivFiles.kt | 22 +------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/core/src/com/unciv/logic/files/UncivFiles.kt b/core/src/com/unciv/logic/files/UncivFiles.kt index bd98e1745c011..99e03b029a6ce 100644 --- a/core/src/com/unciv/logic/files/UncivFiles.kt +++ b/core/src/com/unciv/logic/files/UncivFiles.kt @@ -6,7 +6,6 @@ import com.badlogic.gdx.files.FileHandle import com.badlogic.gdx.utils.GdxRuntimeException import com.badlogic.gdx.utils.JsonReader import com.badlogic.gdx.utils.SerializationException -import com.unciv.Constants import com.unciv.UncivGame import com.unciv.json.fromJsonFile import com.unciv.json.json @@ -16,8 +15,6 @@ import com.unciv.logic.GameInfoPreview import com.unciv.logic.GameInfoSerializationVersion import com.unciv.logic.HasGameInfoSerializationVersion import com.unciv.logic.UncivShowableException -import com.unciv.logic.civilization.PlayerType -import com.unciv.logic.civilization.managers.TurnManager import com.unciv.models.metadata.GameSettings import com.unciv.models.metadata.doMigrations import com.unciv.models.metadata.isMigrationNecessary @@ -321,11 +318,10 @@ class UncivFiles( } //endregion + //region Scenarios - val scenarioFolder = "scenarios" fun getScenarioFiles() = sequence { - for (mod in RulesetCache.values) { val modFolder = mod.folderLocation ?: continue val scenarioFolder = modFolder.child(scenarioFolder) @@ -334,22 +330,6 @@ class UncivFiles( yield(Pair(file, mod)) } } - - fun loadScenario(gameFile: FileHandle): GameInfo { - val game = loadGameFromFile(gameFile) - game.civilizations.removeAll { it.isSpectator() } - for (civ in game.civilizations) - civ.diplomacy.remove(Constants.spectator) - if (game.civilizations.none { it.isHuman() }) - game.civilizations.first { it.isMajorCiv() }.playerType = PlayerType.Human - - game.currentPlayerCiv = game.civilizations.first { it.playerType == PlayerType.Human } - game.currentPlayer = game.currentPlayerCiv.civName - TurnManager(game.currentPlayerCiv).startTurn() - - return game - } - //endregion //region Mod caching