mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Better initialization.
This commit is contained in:
parent
42eb5a48d8
commit
7a2906409f
1 changed files with 3 additions and 9 deletions
|
@ -30,15 +30,9 @@ public class KobaltServer @Inject constructor(val args: Args) : Runnable, IComma
|
|||
val pending = arrayListOf<String>()
|
||||
|
||||
private val COMMAND_CLASSES = listOf(GetDependenciesCommand::class.java, PingCommand::class.java)
|
||||
|
||||
private val COMMANDS = hashMapOf<String, ICommand>()
|
||||
|
||||
init {
|
||||
COMMAND_CLASSES.forEach {
|
||||
val c = Kobalt.INJECTOR.getInstance(it)
|
||||
COMMANDS.put(c.name, c)
|
||||
}
|
||||
}
|
||||
private val COMMANDS = mapOf(*(COMMAND_CLASSES.map { it ->
|
||||
Kobalt.INJECTOR.getInstance(it).let { Pair(it.name, it) }
|
||||
}.toTypedArray()))
|
||||
|
||||
override fun run() {
|
||||
val portNumber = args.port
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue