aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/events/subscription
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-05-07 20:26:04 +0200
committerLinnea Gräf <nea@nea.moe>2024-05-07 20:26:04 +0200
commit8f3cc34740fcfe1572d23c8f1c1db1a309217b84 (patch)
tree1a4d7922b8ec1785e0c1f52fcdf85f3e33f16859 /src/main/kotlin/moe/nea/firmament/events/subscription
parent0cb976ce078b9b0217c9a8e5763638764d89a31e (diff)
downloadFirmament-8f3cc34740fcfe1572d23c8f1c1db1a309217b84.tar.gz
Firmament-8f3cc34740fcfe1572d23c8f1c1db1a309217b84.tar.bz2
Firmament-8f3cc34740fcfe1572d23c8f1c1db1a309217b84.zip
Add @Subscribe annotation
[no changelog]
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/events/subscription')
-rw-r--r--src/main/kotlin/moe/nea/firmament/events/subscription/Subscription.kt18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/events/subscription/Subscription.kt b/src/main/kotlin/moe/nea/firmament/events/subscription/Subscription.kt
new file mode 100644
index 0000000..1e7a6a8
--- /dev/null
+++ b/src/main/kotlin/moe/nea/firmament/events/subscription/Subscription.kt
@@ -0,0 +1,18 @@
+/*
+ * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe>
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+package moe.nea.firmament.events.subscription
+
+import moe.nea.firmament.events.FirmamentEvent
+import moe.nea.firmament.events.FirmamentEventBus
+
+interface SubscriptionOwner
+
+data class Subscription<T : FirmamentEvent>(
+ val owner: SubscriptionOwner,
+ val invoke: (T) -> Unit,
+ val eventBus: FirmamentEventBus<T>,
+)