mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
loading player from json file
This commit is contained in:
@@ -4,6 +4,7 @@ import com.badlogic.gdx.utils.Json
|
||||
import com.badlogic.gdx.utils.JsonValue
|
||||
import com.badlogic.gdx.utils.JsonWriter
|
||||
import net.torvald.terrarum.gameactors.Actor
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.IngamePlayer
|
||||
import net.torvald.terrarum.modulecomputers.virtualcomputer.tvd.ByteArray64
|
||||
import java.math.BigInteger
|
||||
|
||||
@@ -12,11 +13,11 @@ import java.math.BigInteger
|
||||
*/
|
||||
object WriteActor {
|
||||
|
||||
operator fun invoke(actor: Actor): String {
|
||||
operator fun invoke(actor: IngamePlayer): String {
|
||||
return Common.jsoner.toJson(actor)
|
||||
}
|
||||
|
||||
fun encodeToByteArray64(actor: Actor): ByteArray64 {
|
||||
fun encodeToByteArray64(actor: IngamePlayer): ByteArray64 {
|
||||
val ba = ByteArray64()
|
||||
this.invoke(actor).toByteArray().forEach { ba.add(it) }
|
||||
return ba
|
||||
|
||||
Reference in New Issue
Block a user