mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
still wip modularisation, game somehow boots
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
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.Ingame
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-03-20.
|
||||
*/
|
||||
internal object SetTimeDelta : ConsoleCommand {
|
||||
|
||||
val HARD_LIMIT = 60
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
val world = (Terrarum.ingame!! as Ingame).world
|
||||
|
||||
|
||||
if (args.size == 2) {
|
||||
world.time.timeDelta = args[1].toInt()
|
||||
if (world.time.timeDelta == 0)
|
||||
Echo("時間よ止まれ!ザ・ワルド!!")
|
||||
else
|
||||
Echo("Set time delta to ${world.time.timeDelta}")
|
||||
}
|
||||
else {
|
||||
printUsage()
|
||||
}
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
Echo("usage: settimedelta <int>")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user