We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9a3c85 commit eda5d0eCopy full SHA for eda5d0e
1 file changed
src/main/java/in/dragonbra/javasteam/steam/steamclient/SteamClient.kt
@@ -109,6 +109,16 @@ class SteamClient @JvmOverloads constructor(
109
addHandlerCore(handler)
110
}
111
112
+ /**
113
+ * Kotlin Helper:
114
+ * Adds a new handler to the internal list of message handlers.
115
+ * @param T The handler to add.
116
+ */
117
+ inline fun <reified T : ClientMsgHandler> addHandler() {
118
+ val handler = T::class.java.getDeclaredConstructor().newInstance()
119
+ addHandler(handler)
120
+ }
121
+
122
private fun addHandlerCore(handler: ClientMsgHandler) {
123
handler.setup(this)
124
handlers[handler.javaClass] = handler
0 commit comments