Code cleanup
This commit is contained in:
parent
55f279c9b1
commit
c138971230
6 changed files with 13 additions and 3 deletions
2
.idea/codeStyles/codeStyleConfig.xml
generated
2
.idea/codeStyles/codeStyleConfig.xml
generated
|
@ -1,5 +1,5 @@
|
||||||
<component name="ProjectCodeStyleConfiguration">
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
<state>
|
<state>
|
||||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
</state>
|
</state>
|
||||||
</component>
|
</component>
|
6
.idea/kotlinc.xml
generated
Normal file
6
.idea/kotlinc.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="KotlinJpsPluginSettings">
|
||||||
|
<option name="version" value="1.7.10" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -103,7 +103,7 @@ public final class War extends AbstractModule {
|
||||||
result = bold("tie") + ". This means " + bold("WAR");
|
result = bold("tie") + ". This means " + bold("WAR");
|
||||||
}
|
}
|
||||||
|
|
||||||
event.respond(DECK[RANDOM.nextInt(DECK.length)][i] + " " + DECK[RANDOM.nextInt(DECK.length)][y] +
|
event.respond(DECK[RANDOM.nextInt(DECK.length)][i] + " " + DECK[RANDOM.nextInt(DECK.length)][y] +
|
||||||
" » You " + result + '!');
|
" » You " + result + '!');
|
||||||
|
|
||||||
} while (i == y);
|
} while (i == y);
|
||||||
|
|
|
@ -282,11 +282,13 @@ class Mobibot(nickname: String, val channel: String, logsDirPath: String, p: Pro
|
||||||
// Output the usage
|
// Output the usage
|
||||||
HelpFormatter().printHelp(Mobibot::class.java.name, options)
|
HelpFormatter().printHelp(Mobibot::class.java.name, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
commandLine.hasOption(Constants.VERSION_ARG[0]) -> {
|
commandLine.hasOption(Constants.VERSION_ARG[0]) -> {
|
||||||
// Output the version
|
// Output the version
|
||||||
println("${ReleaseInfo.PROJECT} ${ReleaseInfo.VERSION} (${ReleaseInfo.BUILDDATE.toIsoLocalDate()})")
|
println("${ReleaseInfo.PROJECT} ${ReleaseInfo.VERSION} (${ReleaseInfo.BUILDDATE.toIsoLocalDate()})")
|
||||||
println(ReleaseInfo.WEBSITE)
|
println(ReleaseInfo.WEBSITE)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
// Load the properties
|
// Load the properties
|
||||||
val p = Properties()
|
val p = Properties()
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Versions : AbstractCommand() {
|
||||||
"Version : ${ReleaseInfo.VERSION} (${ReleaseInfo.BUILDDATE.toIsoLocalDate()})",
|
"Version : ${ReleaseInfo.VERSION} (${ReleaseInfo.BUILDDATE.toIsoLocalDate()})",
|
||||||
"Platform : ${System.getProperty("os.name")} ${System.getProperty("os.version")}" +
|
"Platform : ${System.getProperty("os.name")} ${System.getProperty("os.version")}" +
|
||||||
" (${System.getProperty("os.arch")})",
|
" (${System.getProperty("os.arch")})",
|
||||||
"Runtimes : Java ${System.getProperty("java.runtime.version")}, Kotlin " + KotlinVersion.CURRENT
|
"Runtimes : Java ${System.getProperty("java.runtime.version")}, Kotlin " + KotlinVersion.CURRENT
|
||||||
)
|
)
|
||||||
override val name = "versions"
|
override val name = "versions"
|
||||||
override val help = listOf("To view the versions data (bot, platform, java, etc.):", helpFormat("%c $name"))
|
override val help = listOf("To view the versions data (bot, platform, java, etc.):", helpFormat("%c $name"))
|
||||||
|
|
|
@ -102,9 +102,11 @@ class RockPaperScissors : AbstractModule() {
|
||||||
hand == botHand -> {
|
hand == botHand -> {
|
||||||
event.respond("${hand.name} vs. ${botHand.name} » You ${"tie".bold()}.")
|
event.respond("${hand.name} vs. ${botHand.name} » You ${"tie".bold()}.")
|
||||||
}
|
}
|
||||||
|
|
||||||
hand.beats(botHand) -> {
|
hand.beats(botHand) -> {
|
||||||
event.respond("${hand.name.bold()} ${hand.action} ${botHand.name} » You ${"win".bold()}!")
|
event.respond("${hand.name.bold()} ${hand.action} ${botHand.name} » You ${"win".bold()}!")
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
event.respond("${botHand.name.bold()} ${botHand.action} ${hand.name} » You ${"lose".bold()}!")
|
event.respond("${botHand.name.bold()} ${botHand.action} ${hand.name} » You ${"lose".bold()}!")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue