Add methods for looking up entries in an enum

Signed-off-by: Graham <gpe@openrs2.org>
bzip2
Graham 3 years ago
parent 6194435313
commit 6a0266e88f
  1. 10
      cache-550/src/main/kotlin/org/openrs2/cache/config/enum/EnumType.kt

@ -97,4 +97,14 @@ public class EnumType(id: Int) : ConfigType(id) {
buf.writeByte(0)
}
public fun getString(key: Int): String {
val strings = strings ?: return defaultString
return strings.getOrDefault(key, defaultString)
}
public fun getInt(key: Int): Int {
val ints = ints ?: return defaultInt
return ints.getOrDefault(key, defaultInt)
}
}

Loading…
Cancel
Save