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
682 B
24 lines
682 B
package org.openrs2.buffer.generator
|
|
|
|
import kotlin.reflect.KClass
|
|
|
|
public enum class IntType(
|
|
public val width: Int,
|
|
private val signedReadType: KClass<*>,
|
|
private val unsignedReadType: KClass<*>,
|
|
public val writeType: KClass<*>
|
|
) {
|
|
BYTE(1, Byte::class, Short::class, Int::class),
|
|
SHORT(2, Short::class, Int::class, Int::class),
|
|
INT(4, Int::class, Long::class, Int::class);
|
|
|
|
public val prettyName: String = name.toLowerCase().capitalize()
|
|
|
|
public fun getReadType(signedness: Signedness): KClass<*> {
|
|
return if (signedness == Signedness.SIGNED) {
|
|
signedReadType
|
|
} else {
|
|
unsignedReadType
|
|
}
|
|
}
|
|
}
|
|
|