com.torvald → net.torvald

Former-commit-id: 375604da8a20a6ba7cd0a8d05a44add02b2d04f4
Former-commit-id: 287287c5920b07618174d7a7573f049d350ded66
This commit is contained in:
Song Minjae
2016-04-12 12:29:02 +09:00
parent 2a34efb489
commit ac9f5b5138
148 changed files with 473 additions and 524 deletions

View File

@@ -0,0 +1,38 @@
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.game.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")
}
}