Silently log ranking stats for each major civ every turn (#8964)

* Record each stat each round for each civilization.

* Implement custom serialization and encapsulate logic in separate CivRankingHistory.kt

* Address comments

* Address comments and add RankingTypeTest.kt
This commit is contained in:
WhoIsJohannes
2023-03-21 13:38:22 +01:00
committed by GitHub
parent 4ba6574419
commit 11be6e2804
6 changed files with 107 additions and 11 deletions

View File

@ -0,0 +1,22 @@
package com.unciv.ui.screens.victoryscreen
import com.unciv.testing.GdxTestRunner
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(GdxTestRunner::class)
class RankingTypeTests {
@Test
fun checkIdForSerializationUniqueness() {
val uniqueIds = HashSet<String>()
for (rankingType in RankingType.values()) {
val id = rankingType.idForSerialization
Assert.assertTrue(
"Id $id for RankingType $rankingType is not unique",
uniqueIds.add(id)
)
}
}
}