Removed deprecated classes and fields from half a year ago

This commit is contained in:
Yair Morgenstern 2018-12-25 22:12:11 +02:00
parent 96d5beeca3
commit 6925b0262f
5 changed files with 4 additions and 65 deletions

View file

@ -15,54 +15,3 @@ class GameSettings {
GameSaver().setGeneralSettings(this)
}
}
@Deprecated("as of 2.6.9")
class OldGameSettings : LinkedHashMap<String, String>() {
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
}
}

View file

@ -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()
}

View file

@ -12,8 +12,6 @@ import com.unciv.ui.utils.getRandom
class GameInfo {
var notifications = mutableListOf<Notification>()
@Deprecated("As of 2.6.9")
var tutorial = mutableListOf<String>()
var civilizations = mutableListOf<CivilizationInfo>()
var difficulty="Chieftain" // difficulty is game-wide, think what would happen if 2 human players could play on diffferent difficulties?
var tileMap: TileMap = TileMap()

View file

@ -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,13 +39,8 @@ 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()
}
}
fun setGeneralSettings(gameSettings: GameSettings){
getGeneralSettingsFile().writeString(json().toJson(gameSettings), false)

View file

@ -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<String>()
var currentParts = Counter<String>()