much simpler way of composing savegame.json

This commit is contained in:
minjaesong
2021-08-24 11:29:21 +09:00
parent dd51cfbe52
commit 67091d0c84
5 changed files with 57 additions and 64 deletions

View File

@@ -13,22 +13,22 @@ import java.io.IOException
/**
* Created by minjaesong on 2017-07-18.
*/
object ExportLayerData : ConsoleCommand {
object ExportMeta : ConsoleCommand {
override fun execute(args: Array<String>) {
try {
val str = WriteMeta(Terrarum.ingame!! as TerrarumIngame).invoke()
val writer = java.io.FileWriter(AppLoader.defaultDir + "/Exports/savegame.json", false)
writer.write(str)
writer.close()
Echo("Exportlayer: exported to savegame.json")
Echo("Exportmeta: exported to savegame.json")
}
catch (e: IOException) {
Echo("Exportlayer: IOException raised.")
Echo("Exportmeta: IOException raised.")
e.printStackTrace()
}
}
override fun printUsage() {
Echo("Usage: exportlayer")
Echo("Usage: Exportmeta")
}
}