File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed
common/src/main/kotlin/com/lambda/interaction/request Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2025 Lambda
3+ *
4+ * This program is free software: you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation, either version 3 of the License, or
7+ * (at your option) any later version.
8+ *
9+ * This program is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ * GNU General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+
18+ package com.lambda.interaction.request
19+
20+ import com.lambda.util.reflections.getInstances
21+
22+ object ManagerUtils {
23+ val managers = getInstances<RequestHandler <* >>()
24+ val accumulatedManagerPriority = managers.map { it.stagePriority }.reduce { acc, priority -> acc + priority }
25+ }
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ import com.lambda.core.Loadable
2222import com.lambda.event.Event
2323import com.lambda.event.events.TickEvent
2424import com.lambda.event.listener.SafeListener.Companion.listen
25+ import com.lambda.interaction.request.ManagerUtils.accumulatedManagerPriority
2526import com.lambda.threading.runSafe
26- import com.lambda.util.reflections.getInstances
2727import kotlin.reflect.KClass
2828
2929/* *
@@ -119,9 +119,4 @@ abstract class RequestHandler<R : Request>(
119119 abstract fun SafeContext.handleRequest (request : R )
120120
121121 protected abstract fun preEvent (): Event
122-
123- companion object {
124- val managers = getInstances<RequestHandler <* >>()
125- val accumulatedManagerPriority = managers.map { it.stagePriority }.reduce { acc, priority -> acc + priority }
126- }
127122}
You can’t perform that action at this time.
0 commit comments