Files
Terrarum/src/net/torvald/terrarum/console/ExportAV.kt
Song Minjae 186d6a8cb9 monitor adjustment screen, changed "calibrate" to "adjust" (NOT the STRING_ID of langpack)
Former-commit-id: ffae41e5876e54e2e0aedb5a93092db8e8f75d01
Former-commit-id: 65883b385a205d47b76c60f18a91186c2be922b2
2016-07-06 20:17:51 +09:00

39 lines
1.0 KiB
Kotlin

package net.torvald.terrarum.console
import net.torvald.JsonWriter
import net.torvald.terrarum.Terrarum
import java.io.IOException
/**
* Created by minjaesong on 16-02-10.
*/
class ExportAV : ConsoleCommand {
override fun execute(args: Array<String>) {
if (args.size == 2) {
try {
JsonWriter.writeToFile(
Terrarum.ingame.player.actorValue,
Terrarum.defaultDir + "/Exports/" + args[1] + ".json")
Echo().execute("ExportAV: exported to " + args[1] + ".json")
}
catch (e: IOException) {
Echo().execute("ExportAV: IOException raised.")
e.printStackTrace()
}
}
else {
printUsage()
}
}
override fun printUsage() {
val echo = Echo()
echo.execute("Export ActorValue as JSON format.")
echo.execute("Usage: exportav (id) filename-without-extension")
echo.execute("blank ID for player")
}
}