mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
Object-ified console commands (singleton!)
Former-commit-id: d04fc939a659fc4a6b952d64894bd28edf97bc38 Former-commit-id: 6c20526f3bdda2d9d08dc156b3b0fe271e89bffb
This commit is contained in:
@@ -5,7 +5,7 @@ import net.torvald.terrarum.Terrarum
|
||||
/**
|
||||
* Created by minjaesong on 16-01-25.
|
||||
*/
|
||||
class Zoom : ConsoleCommand {
|
||||
internal object Zoom : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 2) {
|
||||
|
||||
@@ -14,7 +14,7 @@ class Zoom : ConsoleCommand {
|
||||
zoom = args[1].toFloat()
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
Echo().execute("Wrong number input.")
|
||||
Echo.execute("Wrong number input.")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class Zoom : ConsoleCommand {
|
||||
|
||||
System.gc()
|
||||
|
||||
Echo().execute("Set screen zoom to " + zoom.toString())
|
||||
Echo.execute("Set screen zoom to " + zoom.toString())
|
||||
}
|
||||
else {
|
||||
printUsage()
|
||||
@@ -37,6 +37,6 @@ class Zoom : ConsoleCommand {
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
Echo().execute("Usage: zoom [zoom]")
|
||||
Echo.execute("Usage: zoom [zoom]")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user