mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
moving things around between packages
This commit is contained in:
47
src/net/torvald/terrarum/console/AVTracker.kt
Normal file
47
src/net/torvald/terrarum/console/AVTracker.kt
Normal file
@@ -0,0 +1,47 @@
|
||||
package net.torvald.terrarum.console
|
||||
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.debuggerapp.ActorValueTracker
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-12-29.
|
||||
*/
|
||||
internal object AVTracker : ConsoleCommand {
|
||||
private val jPanelInstances = ArrayList<ActorValueTracker>()
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size < 2) {
|
||||
jPanelInstances.add(ActorValueTracker((Terrarum.ingame!! as TerrarumIngame).actorNowPlaying))
|
||||
}
|
||||
else {
|
||||
try {
|
||||
val actorID = args[1].toInt()
|
||||
|
||||
if (Terrarum.ingame!!.theGameHasActor(actorID)) {
|
||||
jPanelInstances.add(ActorValueTracker(Terrarum.ingame!!.getActorByID(actorID)))
|
||||
}
|
||||
else {
|
||||
throw IllegalArgumentException()
|
||||
}
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
EchoError("Illegal actor ID input")
|
||||
return
|
||||
}
|
||||
catch (e1: IllegalArgumentException) {
|
||||
EchoError("No such actor with specified ID")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
Echo("Pops up new window that provides real-time information about the actor's actor value")
|
||||
}
|
||||
|
||||
fun update() {
|
||||
jPanelInstances.forEach { it.update() }
|
||||
}
|
||||
}
|
||||
28
src/net/torvald/terrarum/console/ActorsList.kt
Normal file
28
src/net/torvald/terrarum/console/ActorsList.kt
Normal file
@@ -0,0 +1,28 @@
|
||||
package net.torvald.terrarum.console
|
||||
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.debuggerapp.ActorsLister
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-12-29.
|
||||
*/
|
||||
internal object ActorsList : ConsoleCommand {
|
||||
private val jPanelInstances = ArrayList<ActorsLister>()
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
jPanelInstances.add(ActorsLister(
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorContainerActive,
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorContainerInactive)
|
||||
)
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
Echo("Pops up new window that displays the list of actors currently in the game")
|
||||
}
|
||||
|
||||
fun update() {
|
||||
jPanelInstances.forEach { it.update() }
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,7 @@ package net.torvald.terrarum.console
|
||||
|
||||
import net.torvald.gdx.graphics.Cvec
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.modulebasegame.weather.WeatherMixer
|
||||
import net.torvald.terrarum.worlddrawer.LightmapRenderer
|
||||
import net.torvald.terrarum.weather.WeatherMixer
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-02-17.
|
||||
|
||||
Reference in New Issue
Block a user