aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/events/subscription/Subscription.kt
blob: a4542e73d61153a40cb39d402895018721a9dfcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * 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
import moe.nea.firmament.features.FirmamentFeature

interface SubscriptionOwner {
    val delegateFeature: FirmamentFeature
}

data class Subscription<T : FirmamentEvent>(
    val owner: SubscriptionOwner,
    val invoke: (T) -> Unit,
    val eventBus: FirmamentEventBus<T>,
)