From 6925b0262ffd955bdb10b0cc0d54863a782d632c Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 25 Dec 2018 22:12:11 +0200 Subject: [PATCH] Removed deprecated classes and fields from half a year ago --- core/src/com/unciv/GameSettings.kt | 53 +------------------ core/src/com/unciv/UnCivGame.kt | 5 +- core/src/com/unciv/logic/GameInfo.kt | 2 - core/src/com/unciv/logic/GameSaver.kt | 8 +-- .../civilization/ScienceVictoryManager.kt | 1 + 5 files changed, 4 insertions(+), 65 deletions(-) diff --git a/core/src/com/unciv/GameSettings.kt b/core/src/com/unciv/GameSettings.kt index 13a511389c..eb05dd7af2 100644 --- a/core/src/com/unciv/GameSettings.kt +++ b/core/src/com/unciv/GameSettings.kt @@ -14,55 +14,4 @@ class GameSettings { fun save(){ GameSaver().setGeneralSettings(this) } -} - - -@Deprecated("as of 2.6.9") -class OldGameSettings : LinkedHashMap() { - fun toGameSettings(): GameSettings { - val newSettings = GameSettings() - newSettings.showResourcesAndImprovements = showResourcesAndImprovements - newSettings.showWorkedTiles = showWorkedTiles - newSettings.language = language - newSettings.resolution = resolution - return newSettings - } - - var showWorkedTiles:Boolean - get() { - if(this.containsKey("ShowWorkedTiles")) return get("ShowWorkedTiles")!!.toBoolean() - else return true - } - set(value) { - this["ShowWorkedTiles"]=value.toString() - } - - var showResourcesAndImprovements:Boolean - get() { - if(this.containsKey("ShowResourcesAndImprovements")) return get("ShowResourcesAndImprovements")!!.toBoolean() - else return true - } - set(value) { - this["ShowResourcesAndImprovements"]=value.toString() - } - - var language:String - get() { - if(this.containsKey("Language")) return get("Language")!! - else return "English" - } - set(value) { - this["Language"]=value - } - - var resolution:String - get() { - if(this.containsKey("Resolution")) return get("Resolution")!! - else return "1050x700" - } - set(value) { - this["Resolution"]=value - } -} - - +} \ No newline at end of file diff --git a/core/src/com/unciv/UnCivGame.kt b/core/src/com/unciv/UnCivGame.kt index d42f058e89..53dbcb7567 100644 --- a/core/src/com/unciv/UnCivGame.kt +++ b/core/src/com/unciv/UnCivGame.kt @@ -21,7 +21,7 @@ class UnCivGame : Game() { val viewEntireMapForDebug = false // For when you need to test something in an advanced game and don't have time to faff around - val superchargedForDebug = true + val superchargedForDebug = false lateinit var worldScreen: WorldScreen @@ -43,9 +43,6 @@ class UnCivGame : Game() { fun loadGame(gameInfo:GameInfo){ this.gameInfo = gameInfo - if(settings.tutorialsShown.isEmpty() && this.gameInfo.tutorial.isNotEmpty()) - settings.tutorialsShown.addAll(this.gameInfo.tutorial) - worldScreen = WorldScreen() setWorldScreen() } diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 650a2abc5e..611714b3b9 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -12,8 +12,6 @@ import com.unciv.ui.utils.getRandom class GameInfo { var notifications = mutableListOf() - @Deprecated("As of 2.6.9") - var tutorial = mutableListOf() var civilizations = mutableListOf() var difficulty="Chieftain" // difficulty is game-wide, think what would happen if 2 human players could play on diffferent difficulties? var tileMap: TileMap = TileMap() diff --git a/core/src/com/unciv/logic/GameSaver.kt b/core/src/com/unciv/logic/GameSaver.kt index 7abd667f94..1b344e1546 100644 --- a/core/src/com/unciv/logic/GameSaver.kt +++ b/core/src/com/unciv/logic/GameSaver.kt @@ -4,7 +4,6 @@ import com.badlogic.gdx.Gdx import com.badlogic.gdx.files.FileHandle import com.badlogic.gdx.utils.Json import com.unciv.GameSettings -import com.unciv.OldGameSettings class GameSaver { private val saveFilesFolder = "SaveFiles" @@ -40,12 +39,7 @@ class GameSaver { fun getGeneralSettings(): GameSettings { val settingsFile = getGeneralSettingsFile() if(!settingsFile.exists()) return GameSettings() - try { - return json().fromJson(GameSettings::class.java, settingsFile) - } - catch(ex:Exception) { - return json().fromJson(OldGameSettings::class.java, settingsFile).toGameSettings() - } + return json().fromJson(GameSettings::class.java, settingsFile) } fun setGeneralSettings(gameSettings: GameSettings){ diff --git a/core/src/com/unciv/logic/civilization/ScienceVictoryManager.kt b/core/src/com/unciv/logic/civilization/ScienceVictoryManager.kt index 478ed397c2..b0c0782b10 100644 --- a/core/src/com/unciv/logic/civilization/ScienceVictoryManager.kt +++ b/core/src/com/unciv/logic/civilization/ScienceVictoryManager.kt @@ -2,6 +2,7 @@ package com.unciv.logic.civilization import com.unciv.models.Counter +@Deprecated("As of 2.11.3") class ScienceVictoryManager { var requiredParts = Counter() var currentParts = Counter()