removed unnecessary class Light10B, minor fixes for LightmapRenderer

Former-commit-id: 4cddfb080cc689738d9bf308f7d08852f4c78a8b
Former-commit-id: 2354b2483f30e70862a327c1b9688a19bd1b2f66
This commit is contained in:
Song Minjae
2016-09-07 22:58:42 +09:00
parent d817c586e9
commit 9b9b65efba
31 changed files with 3718 additions and 134 deletions

View File

@@ -38,6 +38,8 @@ object CommandDict {
Pair("help", Help()),
Pair("version", Version()),
Pair("seed", Seed()),
Pair("testgetlight", TestGetLight()),
Pair("println", EchoConsole()),
// Test codes
Pair("bulletintest", SetBulletin()),

View File

@@ -0,0 +1,33 @@
package net.torvald.terrarum.console
/**
* Created by minjaesong on 16-09-07.
*/
class EchoConsole : ConsoleCommand {
/**
* Args 0: command given
* Args 1: first argument
*
* e.g. in ```setav mass 74```, zeroth args will be ```setav```.
*/
override fun execute(args: Array<String>) {
val argsWoHeader = Array<String>(args.size - 1, {it -> args[it + 1]})
argsWoHeader.forEach { execute(it) }
}
fun execute(single_line: String) {
val sb = StringBuilder()
for (ch in single_line) {
if (ch == '\n') {
println(sb.toString())
sb.delete(0, sb.length - 1)
}
else
sb.append(ch)
}
println(sb.toString())
}
override fun printUsage() {
}
}

View File

@@ -0,0 +1,24 @@
package net.torvald.terrarum.console
import net.torvald.terrarum.mapdrawer.LightmapRenderer
/**
* Created by minjaesong on 16-09-07.
*/
class TestGetLight : ConsoleCommand {
/**
* Args 0: command given
* Args 1: first argument
*
* e.g. in ```setav mass 74```, zeroth args will be ```setav```.
*/
override fun execute(args: Array<String>) {
val x = args[1].toInt()
val y = args[2].toInt()
val l = LightmapRenderer.getLightRawPos(16, 16)
EchoConsole().execute(l.toString())
}
override fun printUsage() {
}
}