Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
522 B
24 lines
522 B
package org.openrs2.cache
|
|
|
|
public enum class Js5Protocol {
|
|
ORIGINAL,
|
|
VERSIONED,
|
|
SMART;
|
|
|
|
public val id: Int
|
|
get() = ordinal + OFFSET
|
|
|
|
public companion object {
|
|
private const val OFFSET = 5
|
|
private val values = values()
|
|
|
|
public fun fromId(id: Int): Js5Protocol? {
|
|
val ordinal = id - OFFSET
|
|
return if (ordinal >= 0 && ordinal < values.size) {
|
|
values[ordinal]
|
|
} else {
|
|
null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|