layer export: tested output seems legit but can't confirm

This commit is contained in:
minjaesong
2018-10-04 23:46:24 +09:00
parent 071dc85b94
commit 374070e9b9
8 changed files with 25 additions and 24 deletions

View File

@@ -2,26 +2,25 @@ package net.torvald.terrarum.modulebasegame.console
import net.torvald.terrarum.console.ConsoleCommand
import net.torvald.terrarum.console.Echo
import net.torvald.terrarum.serialise.WriteLayerData
import net.torvald.terrarum.console.EchoError
import net.torvald.terrarum.serialise.WriteLayerDataZip
/**
* Created by minjaesong on 2017-07-18.
*/
object ExportLayerData : ConsoleCommand {
override fun execute(args: Array<String>) {
if (args.size < 2) {
printUsage()
return
try {
val outfile = WriteLayerDataZip()
Echo("Layer data exported to ${outfile!!.canonicalPath}")
}
catch (e: Exception) {
e.printStackTrace()
EchoError("Layer data export failed; see console for error traces.")
}
val saveDirectoryName = args[1]
WriteLayerData(saveDirectoryName)
Echo("Layer data exported to $saveDirectoryName/${WriteLayerData.LAYERS_FILENAME}")
}
override fun printUsage() {
Echo("Usage: exportlayer savename")
Echo("Usage: exportlayer")
}
}