mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 03:54:06 +09:00
Object-ified console commands (singleton!)
Former-commit-id: d04fc939a659fc4a6b952d64894bd28edf97bc38 Former-commit-id: 6c20526f3bdda2d9d08dc156b3b0fe271e89bffb
This commit is contained in:
@@ -5,20 +5,20 @@ import net.torvald.terrarum.Terrarum
|
||||
/**
|
||||
* Created by minjaesong on 16-03-20.
|
||||
*/
|
||||
class SetTimeDelta : ConsoleCommand {
|
||||
internal object SetTimeDelta : ConsoleCommand {
|
||||
|
||||
val HARD_LIMIT = 60
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 2) {
|
||||
if (args[1].toInt() > HARD_LIMIT)
|
||||
Error().execute("Delta too large -- acceptable delta is 0-60.")
|
||||
Error.execute("Delta too large -- acceptable delta is 0-60.")
|
||||
|
||||
Terrarum.ingame.world.time.setTimeDelta(args[1].toInt())
|
||||
if (Terrarum.ingame.world.time.timeDelta == 0)
|
||||
Echo().execute("時間よ止まれ!ザ・ワルド!!")
|
||||
Echo.execute("時間よ止まれ!ザ・ワルド!!")
|
||||
else
|
||||
Echo().execute("Set time delta to ${Terrarum.ingame.world.time.timeDelta}")
|
||||
Echo.execute("Set time delta to ${Terrarum.ingame.world.time.timeDelta}")
|
||||
}
|
||||
else {
|
||||
printUsage()
|
||||
@@ -26,6 +26,6 @@ class SetTimeDelta : ConsoleCommand {
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
Echo().execute("usage: settimedelta <int>")
|
||||
Echo.execute("usage: settimedelta <int>")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user