private void UnsubscribeAll() { _eventBus.Unsubscribe <GameStateChangedDomainEvent>(GameStateChangedDomainEvent.GetId(), OnGameStateChangedDomainEventAsync); _eventBus.Unsubscribe <PlayerAddedToVesselRoleDomainEvent>(PlayerAddedToVesselRoleDomainEvent.GetId(), OnPlayerAddedToVesselRoleDomainEventAsync); _eventBus.Unsubscribe <PlayerJoinedGameDomainEvent>(PlayerJoinedGameDomainEvent.GetId(), OnPlayerJoinedGameDomainEventAsync); _eventBus.Unsubscribe <PlayerLeftGameDomainEvent>(PlayerLeftGameDomainEvent.GetId(), OnPlayerLeftGameDomainEventAsync); _eventBus.Unsubscribe <PlayerRemovedFromVesselRoleDomainEvent>(PlayerRemovedFromVesselRoleDomainEvent.GetId(), OnPlayerRemovedFromVesselRoleDomainEventAsync); _eventBus.Unsubscribe <PlayerSignedInDomainEvent>(PlayerSignedInDomainEvent.GetId(), OnPlayerSignedInDomainEventAsync); _eventBus.Unsubscribe <PlayerSignedOutDomainEvent>(PlayerSignedOutDomainEvent.GetId(), OnPlayerSignedOutDomainEventAsync); _eventBus.Unsubscribe <VesselStateChangedDomainEvent>(VesselStateChangedDomainEvent.GetId(), OnVesselStateChangedDomainEventAsync); }
private Task OnGameStateChangedDomainEventAsync(GameStateChangedDomainEvent evt) { var gameDto = DomainGameService.MapToGameDto(evt.Game); return(PublishIfEnabledAsync(GameStateChangedEvent.FromGame(gameDto))); }