mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07:00
internal - Enable writing new format of civ ranking history
This commit is contained in:
parent
9c7e5b3ae6
commit
4394dcda7a
@ -31,17 +31,9 @@ class CivRankingHistory : HashMap<Int, Map<RankingType, Int>>(), IsPartOfGameInf
|
||||
override fun write(json: Json) {
|
||||
for ((turn, rankings) in this) {
|
||||
|
||||
// Old format - deprecated 4.12.18
|
||||
json.writeObjectStart(turn.toString())
|
||||
for ((rankingType, score) in rankings) {
|
||||
json.writeValue(rankingType.idForSerialization.toString(), score)
|
||||
}
|
||||
json.writeObjectEnd()
|
||||
|
||||
// New format (disabled)
|
||||
// val rankingsString = rankings.entries
|
||||
// .joinToString("") { it.key.idForSerialization.toString() + it.value }
|
||||
// json.writeValue(turn.toString(), rankingsString)
|
||||
val rankingsString = rankings.entries
|
||||
.joinToString("") { it.key.idForSerialization.toString() + it.value }
|
||||
json.writeValue(turn.toString(), rankingsString)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user