8000 Class Hierarchy for FXEvents · Issue #38 · edvin/tornadofx2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Class Hierarchy for FXEvents #38
Open
@xeruf

Description

@xeruf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0