mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
26 lines
701 B
Kotlin
26 lines
701 B
Kotlin
package net.torvald.terrarum.modulebasegame.console
|
|
|
|
import net.torvald.terrarum.Terrarum
|
|
import net.torvald.terrarum.console.ConsoleCommand
|
|
import net.torvald.terrarum.console.Echo
|
|
import net.torvald.terrarum.modulebasegame.gameactors.DecodeTapestry
|
|
import java.io.File
|
|
|
|
/**
|
|
* Created by minjaesong on 2017-01-14.
|
|
*/
|
|
internal object SpawnTapestry : ConsoleCommand {
|
|
override fun execute(args: Array<String>) {
|
|
if (args.size < 2) {
|
|
printUsage()
|
|
return
|
|
}
|
|
|
|
val tapestry = DecodeTapestry(File(args[1]))
|
|
Terrarum.ingame!!.addNewActor(tapestry)
|
|
}
|
|
|
|
override fun printUsage() {
|
|
Echo("Usage: spawntapestry <tapestry_file>")
|
|
}
|
|
} |