Signed-off-by: Graham <gpe@openrs2.org>
@ -11,6 +11,7 @@ application {
dependencies {
api(libs.clikt)
implementation(projects.util)
implementation(libs.kotlinPoet)
implementation(libs.netty.buffer)
}
@ -1,5 +1,6 @@
package org.openrs2.buffer.generator
import org.openrs2.util.capitalize
import kotlin.reflect.KClass
public enum class IntType(
@ -5,6 +5,7 @@ import org.openrs2.asm.MemberRef
import org.openrs2.asm.classpath.ClassPath
import org.openrs2.asm.filter.MemberFilter
import org.openrs2.deob.util.map.NameMap
import org.openrs2.util.collect.DisjointSet
import org.openrs2.util.indefiniteArticle
@ -18,3 +18,7 @@ public fun CharSequence.krHashCode(): Int {
return hash
public fun String.capitalize(): String {
return replaceFirstChar { it.titlecase() }
@ -20,4 +20,11 @@ class StringUtilsTest {
assertEquals(99162322, "hello".krHashCode())
assertEquals(92340183, "h€llo".krHashCode())
@Test
fun testCapitalize() {
assertEquals("Hello", "hello".capitalize())
assertEquals("Hello", "Hello".capitalize())
assertEquals("HELLO", "HELLO".capitalize())