Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class Hierarchy for FXEvents #38

Open
xeruf opened this issue May 27, 2021 · 0 comments
Open

Class Hierarchy for FXEvents #38

xeruf opened this issue May 27, 2021 · 0 comments

Comments

@xeruf
Copy link

xeruf commented May 27, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant