mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
tevd update; seemingly working savefile export
This commit is contained in:
@@ -13,12 +13,12 @@ import java.math.BigInteger
|
||||
*/
|
||||
object WriteActor {
|
||||
|
||||
operator fun invoke(actor: IngamePlayer): String {
|
||||
operator fun invoke(actor: Actor): String {
|
||||
val s = Common.jsoner.toJson(actor, actor.javaClass)
|
||||
return """{"class":"${actor.javaClass.canonicalName}",${s.substring(1)}"""
|
||||
}
|
||||
|
||||
fun encodeToByteArray64(actor: IngamePlayer): ByteArray64 {
|
||||
fun encodeToByteArray64(actor: Actor): ByteArray64 {
|
||||
val ba = ByteArray64()
|
||||
this.invoke(actor).toByteArray().forEach { ba.add(it) }
|
||||
return ba
|
||||
|
||||
Reference in New Issue
Block a user