Remove default values that were serialized per tile - reduced 12.5% of file size!

This commit is contained in:
yairm210
2024-08-06 15:47:48 +03:00
parent 4e85e32cc1
commit f4b76e99de

View File

@ -1076,8 +1076,8 @@ class Tile : IsPartOfGameInfoSerialization, Json.Serializable {
override fun write(json: Json) { override fun write(json: Json) {
json.writeFields(this) json.writeFields(this)
// Compatibility code for the case an improvementQueue-using game is loaded by an older version: Write fake fields // Compatibility code for the case an improvementQueue-using game is loaded by an older version: Write fake fields
json.writeValue("improvementInProgress", improvementInProgress, String::class.java) if (improvementInProgress != null) json.writeValue("improvementInProgress", improvementInProgress, String::class.java)
json.writeValue("turnsToImprovement", turnsToImprovement, Int::class.java) if (turnsToImprovement != 0) json.writeValue("turnsToImprovement", turnsToImprovement, Int::class.java)
} }
override fun read(json: Json, jsonData: JsonValue) { override fun read(json: Json, jsonData: JsonValue) {