Fix subscribeAll

This commit is contained in:
Him188 2019-10-11 18:10:54 +08:00
parent d59c7165eb
commit c09d44f45a

View File

@ -64,10 +64,7 @@ fun <E : Event> KClass<E>.subscribeAll(listeners: ListenerBuilder<E>.() -> Unit)
* 监听一个事件. 可同时进行多种方式的监听
* @see ListenerBuilder
*/
inline fun <reified E : Event> subscribeAll(noinline listeners: ListenerBuilder<E>.() -> Unit) {
ListenerBuilder<E> { this.subscribeInternal(it) }.apply(listeners)
}
inline fun <reified E : Event> subscribeAll(noinline listeners: ListenerBuilder<E>.() -> Unit) = E::class.subscribeAll(listeners)
/**
* 监听构建器. 可同时进行多种方式的监听