mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 04:24:05 +09:00
com.torvald → net.torvald
Former-commit-id: 375604da8a20a6ba7cd0a8d05a44add02b2d04f4 Former-commit-id: 287287c5920b07618174d7a7573f049d350ded66
This commit is contained in:
51
src/net/torvald/terrarum/console/GetFactioning.kt
Normal file
51
src/net/torvald/terrarum/console/GetFactioning.kt
Normal file
@@ -0,0 +1,51 @@
|
||||
package net.torvald.terrarum.console
|
||||
|
||||
import net.torvald.terrarum.gameactors.faction.Faction
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.Terrarum
|
||||
|
||||
import java.util.HashSet
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-02-17.
|
||||
*/
|
||||
class GetFactioning : ConsoleCommand {
|
||||
|
||||
private val PRINT_INDENTATION = " --> "
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
val echo = Echo()
|
||||
|
||||
if (args.size == 1) {
|
||||
// get all factioning data of player
|
||||
val factionSet = Terrarum.game.player.faction
|
||||
|
||||
if (factionSet.isEmpty()) {
|
||||
echo.execute("The actor has empty faction set.")
|
||||
return
|
||||
}
|
||||
|
||||
val count = factionSet.size
|
||||
echo.execute(count.toString() + Lang.pluralise(" faction", count) + " assigned.")
|
||||
|
||||
for (faction in factionSet) {
|
||||
echo.execute("faction “${faction.factionName}”")
|
||||
echo.execute(" Amicable")
|
||||
faction.factionAmicable.forEach { s -> echo.execute(PRINT_INDENTATION + s) }
|
||||
|
||||
echo.execute(" Explicit neutral")
|
||||
faction.factionNeutral.forEach { s -> echo.execute(PRINT_INDENTATION + s) }
|
||||
|
||||
echo.execute(" Hostile")
|
||||
faction.factionHostile.forEach { s -> echo.execute(PRINT_INDENTATION + s) }
|
||||
|
||||
echo.execute(" Fearful")
|
||||
faction.factionFearful.forEach { s -> echo.execute(PRINT_INDENTATION + s) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user