Removed deprecated classes and fields from half a year ago
This commit is contained in:
parent
96d5beeca3
commit
6925b0262f
5 changed files with 4 additions and 65 deletions
|
@ -14,55 +14,4 @@ class GameSettings {
|
|||
fun save(){
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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>()
|
||||
|
|
Loading…
Reference in a new issue