I would like to have a group of FXEvents to which I can subscribe all at once and then selectively filter out the specific events, e.g.:
sealed class GameUpdateEvent: FXEvent()
class GameReadyEvent: GameUpdateEvent()
data class NewGameState(val gameState: IGameState): GameUpdateEvent()
data class GamePausedEvent(val paused: Boolean): GameUpdateEvent()
data class GameOverEvent(val result: GameResult): GameUpdateEvent()
subscribe<GameUpdateEvent> { event ->
// check event
}
But from what it seems, the subscribe class has to match exactly, no subclasses. This is not so wild for the subscription, but really annoying if I then want to remove all subscriptions of all subclasses.
I would like to have a group of FXEvents to which I can subscribe all at once and then selectively filter out the specific events, e.g.:
But from what it seems, the subscribe class has to match exactly, no subclasses. This is not so wild for the subscription, but really annoying if I then want to remove all subscriptions of all subclasses.