tile damage and wire layers are now save/loaded

This commit is contained in:
minjaesong
2021-08-26 23:11:03 +09:00
parent e5c25c5a10
commit c2fdb4b26a
15 changed files with 390 additions and 270 deletions

View File

@@ -12,23 +12,8 @@ import java.math.BigInteger
*/
object WriteActor {
private val jsoner = Json(JsonWriter.OutputType.json)
// install custom (de)serialiser
init {
jsoner.setSerializer(BigInteger::class.java, object : Json.Serializer<BigInteger> {
override fun write(json: Json, obj: BigInteger?, knownType: Class<*>?) {
json.writeValue(obj?.toString())
}
override fun read(json: Json, jsonData: JsonValue, type: Class<*>?): BigInteger {
return BigInteger(jsonData.asString())
}
})
}
operator fun invoke(actor: Actor): String {
return jsoner.toJson(actor)
return Common.jsoner.toJson(actor)
}
fun encodeToByteArray64(actor: Actor): ByteArray64 {