Fix nitpicks in Mining plugin

Also adds equals() and hashcode() implementations to the various
Mining actions.
This commit is contained in:
Major
2018-03-28 16:50:43 +01:00
parent 173623b76b
commit 6941fc9de0
5 changed files with 257 additions and 214 deletions
+10 -9
View File
@@ -1,12 +1,13 @@
package org.apollo.game.plugin.skills.mining
enum class Gem(val id: Int, val chance: Int) {
UNCUT_SAPPHIRE(1623, 0),
UNCUT_EMERALD(1605, 0),
UNCUT_RUBY(1619, 0),
UNCUT_DIAMOND(1617, 0)
}
enum class Gem(val id: Int) { // TODO add gem drop chances
UNCUT_SAPPHIRE(1623),
UNCUT_EMERALD(1605),
UNCUT_RUBY(1619),
UNCUT_DIAMOND(1617);
val GEMS = Gem.values()
fun lookupGem(id: Int): Gem? = GEMS.find { it.id == id }
companion object {
private val GEMS = Gem.values().associateBy({ it.id }, { it })
fun lookup(id: Int): Gem? = GEMS[id]
}
}