mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-06 08:21:36 +07:00
In-depth serialization improvement, fixes Barbarian Camps revealed by Honor not showing immediately in multiplayer
* Fix Barbarian Camp Spawned notification not revealing the camp on the map in multiplayer * Fix lastSeenImprovement not being cloned * Use HashMapVector2 in BarbarianManager * Fix value not having its class written out for proper deserializing * Refactor: various code improvements
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.unciv.testing
|
||||
|
||||
import com.unciv.UncivGame
|
||||
import com.unciv.json.json
|
||||
import com.unciv.logic.GameInfo
|
||||
import com.unciv.logic.GameSaver
|
||||
import com.unciv.logic.GameStarter
|
||||
@ -83,7 +84,7 @@ class SerializationTests {
|
||||
@Test
|
||||
fun canSerializeGame() {
|
||||
val json = try {
|
||||
GameSaver.json().toJson(game)
|
||||
json().toJson(game)
|
||||
} catch (ex: Exception) {
|
||||
""
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
package com.unciv.testing
|
||||
|
||||
import com.badlogic.gdx.utils.Array
|
||||
import com.unciv.JsonParser
|
||||
import com.unciv.json.fromJsonFile
|
||||
import com.unciv.json.json
|
||||
import com.unciv.models.Tutorial
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
@ -16,7 +17,7 @@ class TutorialTranslationTests {
|
||||
|
||||
@Test
|
||||
fun tutorialsFileIsSerializable() {
|
||||
val map = JsonParser().getFromJson(LinkedHashMap<String, Array<String>>().javaClass, "jsons/Tutorials.json")
|
||||
val map = json().fromJsonFile(LinkedHashMap<String, Array<String>>().javaClass, "jsons/Tutorials.json")
|
||||
|
||||
assertTrue("The number of items from Tutorials.json must match to the enum Tutorial",
|
||||
map.size == tutorialCount)
|
||||
|
Reference in New Issue
Block a user