still working on the new savegame scheme

main game works fine, saving/loading will not be possible
This commit is contained in:
minjaesong
2021-10-07 17:43:23 +09:00
parent 6d8a7520ac
commit 3f9b41fd29
23 changed files with 200 additions and 86 deletions

View File

@@ -17,6 +17,7 @@ import java.io.InputStream
import java.io.Reader
import java.io.StringReader
import java.math.BigInteger
import java.util.*
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
@@ -172,6 +173,16 @@ object Common {
return hashMap
}
})
// UUID
jsoner.setSerializer(UUID::class.java, object : Json.Serializer<UUID> {
override fun write(json: Json, obj: UUID, knownType: Class<*>?) {
json.writeValue(obj.toString())
}
override fun read(json: Json, jsonData: JsonValue, type: Class<*>?): UUID {
return UUID.fromString(jsonData.asString())
}
})
}
private data class LayerInfo(val h: String, val b: String, val x: Int, val y: Int)