Now ignore unknown fields on all jsons

This commit is contained in:
Yair Morgenstern 2019-02-10 23:27:48 +02:00
parent e3bf80091a
commit d080f37a94
2 changed files with 2 additions and 2 deletions

View File

@ -216,7 +216,7 @@ class NextTurnAutomation{
&& civInfo.cities.none { it.cityConstructions.currentConstruction == "Settler" }) {
val bestCity = civInfo.cities.maxBy { it.cityStats.currentCityStats.production }!!
if (bestCity.cityConstructions.builtBuildings.size > 1) // 2 buildings or more, otherwisse focus on self first
if (bestCity.cityConstructions.builtBuildings.size > 1) // 2 buildings or more, otherwise focus on self first
bestCity.cityConstructions.currentConstruction = "Settler"
}
}

View File

@ -28,7 +28,7 @@ object GameBasics {
fun <T> getFromJson(tClass: Class<T>, name: String): T {
val jsonText = Gdx.files.internal("jsons/$name.json").readString()
return Json().fromJson(tClass, jsonText)
return Json().apply { ignoreUnknownFields=true }.fromJson(tClass, jsonText)
}
private fun <T : INamed> createHashmap(items: Array<T>): LinkedHashMap<String, T> {