mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-12 00:39:56 +07:00
Removed deprecated classes and fields from half a year ago
This commit is contained in:
@ -15,54 +15,3 @@ class GameSettings {
|
|||||||
GameSaver().setGeneralSettings(this)
|
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
|
val viewEntireMapForDebug = false
|
||||||
|
|
||||||
// For when you need to test something in an advanced game and don't have time to faff around
|
// 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
|
lateinit var worldScreen: WorldScreen
|
||||||
|
|
||||||
@ -43,9 +43,6 @@ class UnCivGame : Game() {
|
|||||||
|
|
||||||
fun loadGame(gameInfo:GameInfo){
|
fun loadGame(gameInfo:GameInfo){
|
||||||
this.gameInfo = gameInfo
|
this.gameInfo = gameInfo
|
||||||
if(settings.tutorialsShown.isEmpty() && this.gameInfo.tutorial.isNotEmpty())
|
|
||||||
settings.tutorialsShown.addAll(this.gameInfo.tutorial)
|
|
||||||
|
|
||||||
worldScreen = WorldScreen()
|
worldScreen = WorldScreen()
|
||||||
setWorldScreen()
|
setWorldScreen()
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,6 @@ import com.unciv.ui.utils.getRandom
|
|||||||
|
|
||||||
class GameInfo {
|
class GameInfo {
|
||||||
var notifications = mutableListOf<Notification>()
|
var notifications = mutableListOf<Notification>()
|
||||||
@Deprecated("As of 2.6.9")
|
|
||||||
var tutorial = mutableListOf<String>()
|
|
||||||
var civilizations = mutableListOf<CivilizationInfo>()
|
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 difficulty="Chieftain" // difficulty is game-wide, think what would happen if 2 human players could play on diffferent difficulties?
|
||||||
var tileMap: TileMap = TileMap()
|
var tileMap: TileMap = TileMap()
|
||||||
|
@ -4,7 +4,6 @@ import com.badlogic.gdx.Gdx
|
|||||||
import com.badlogic.gdx.files.FileHandle
|
import com.badlogic.gdx.files.FileHandle
|
||||||
import com.badlogic.gdx.utils.Json
|
import com.badlogic.gdx.utils.Json
|
||||||
import com.unciv.GameSettings
|
import com.unciv.GameSettings
|
||||||
import com.unciv.OldGameSettings
|
|
||||||
|
|
||||||
class GameSaver {
|
class GameSaver {
|
||||||
private val saveFilesFolder = "SaveFiles"
|
private val saveFilesFolder = "SaveFiles"
|
||||||
@ -40,13 +39,8 @@ class GameSaver {
|
|||||||
fun getGeneralSettings(): GameSettings {
|
fun getGeneralSettings(): GameSettings {
|
||||||
val settingsFile = getGeneralSettingsFile()
|
val settingsFile = getGeneralSettingsFile()
|
||||||
if(!settingsFile.exists()) return GameSettings()
|
if(!settingsFile.exists()) return GameSettings()
|
||||||
try {
|
|
||||||
return json().fromJson(GameSettings::class.java, settingsFile)
|
return json().fromJson(GameSettings::class.java, settingsFile)
|
||||||
}
|
}
|
||||||
catch(ex:Exception) {
|
|
||||||
return json().fromJson(OldGameSettings::class.java, settingsFile).toGameSettings()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setGeneralSettings(gameSettings: GameSettings){
|
fun setGeneralSettings(gameSettings: GameSettings){
|
||||||
getGeneralSettingsFile().writeString(json().toJson(gameSettings), false)
|
getGeneralSettingsFile().writeString(json().toJson(gameSettings), false)
|
||||||
|
@ -2,6 +2,7 @@ package com.unciv.logic.civilization
|
|||||||
|
|
||||||
import com.unciv.models.Counter
|
import com.unciv.models.Counter
|
||||||
|
|
||||||
|
@Deprecated("As of 2.11.3")
|
||||||
class ScienceVictoryManager {
|
class ScienceVictoryManager {
|
||||||
var requiredParts = Counter<String>()
|
var requiredParts = Counter<String>()
|
||||||
var currentParts = Counter<String>()
|
var currentParts = Counter<String>()
|
||||||
|
Reference in New Issue
Block a user