mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
working tapestry decoder and fixture object
Former-commit-id: dd61b61e6061cfb3dc2ad9d9f65fd1b272475718 Former-commit-id: 7acc72a0e59203c0ea56c355eadaeed1474e3ac1
This commit is contained in:
@@ -50,7 +50,8 @@ object CommandDict {
|
||||
Pair("testgetlight", TestGetLight),
|
||||
Pair("spawnball", SpawnPhysTestBall),
|
||||
Pair("spawntorch", SpawnTikiTorch),
|
||||
Pair("musictest", MusicTest)
|
||||
Pair("musictest", MusicTest),
|
||||
Pair("spawntapestry", SpawnTapestry)
|
||||
)
|
||||
|
||||
operator fun get(commandName: String): ConsoleCommand {
|
||||
|
||||
25
src/net/torvald/terrarum/console/SpawnTapestry.kt
Normal file
25
src/net/torvald/terrarum/console/SpawnTapestry.kt
Normal file
@@ -0,0 +1,25 @@
|
||||
package net.torvald.terrarum.console
|
||||
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.DecodeTapestry
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
|
||||
/**
|
||||
* Created by SKYHi14 on 2017-01-14.
|
||||
*/
|
||||
object SpawnTapestry : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size < 2) {
|
||||
printUsage()
|
||||
return
|
||||
}
|
||||
|
||||
val tapestry = DecodeTapestry(File(args[1]))
|
||||
Terrarum.ingame.addActor(tapestry)
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
println("Usage: spawntapestry <tapestry_file>")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user