You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
288 B
Kotlin

package me.eater.threedom.event
import me.eater.threedom.generated.EventNames
interface EventListener {
fun <T> on(eventName: String, block: (Event<T>) -> Unit)
}
inline fun <reified T> EventListener.on(noinline block: (Event<T>) -> Unit) = on(EventNames.getEventName<T>(), block)