private Task OnPlayerRemovedFromVesselRoleDomainEventAsync(PlayerRemovedFromVesselRoleDomainEvent evt)
        {
            var vesselDto = DomainGameService.MapToVesselDto(evt.Vessel);
            var playerDto = DomainGameService.MapToPlayerDto(evt.Player);

            return(PublishIfEnabledAsync(PlayerRemovedFromVesselRoleEvent.FromPlayerInGameVesselRole(
                                             evt.GameId,
                                             vesselDto,
                                             evt.VesselRole.Name,
                                             playerDto
                                             )));
        }
Example #2
0
 private void UnsubscribeAll()
 {
     _eventBus.Unsubscribe <ChatMessageSentEvent>(ChatMessageSentEvent.GetId(), OnChatMessageSentEventAsync);
     _eventBus.Unsubscribe <GameStateChangedEvent>(GameStateChangedEvent.GetId(), OnGameStateChangedEventAsync);
     _eventBus.Unsubscribe <PlayerAddedToVesselRoleEvent>(PlayerAddedToVesselRoleEvent.GetId(), OnPlayerAddedToVesselRoleEventAsync);
     _eventBus.Unsubscribe <PlayerJoinedGameEvent>(PlayerJoinedGameEvent.GetId(), OnPlayerJoinedGameEventAsync);
     _eventBus.Unsubscribe <PlayerLeftGameEvent>(PlayerLeftGameEvent.GetId(), OnPlayerLeftGameEventAsync);
     _eventBus.Unsubscribe <PlayerRemovedFromVesselRoleEvent>(PlayerRemovedFromVesselRoleEvent.GetId(), OnPlayerRemovedFromVesselRoleEventAsync);
     _eventBus.Unsubscribe <PlayerSignedInEvent>(PlayerSignedInEvent.GetId(), OnPlayerSignedInEventAsync);
     _eventBus.Unsubscribe <PlayerSignedOutEvent>(PlayerSignedOutEvent.GetId(), OnPlayerSignedOutEventAsync);
     _eventBus.Unsubscribe <VesselMovedInDirectionEvent>(VesselMovedInDirectionEvent.GetId(), OnVesselMovedInDirectionEventAsync);
     _eventBus.Unsubscribe <VesselStateChangedEvent>(VesselStateChangedEvent.GetId(), OnVesselStateChangedEventAsync);
 }
Example #3
0
 protected async Task OnPlayerRemovedFromVesselRoleEventAsync(PlayerRemovedFromVesselRoleEvent evt) =>
 await OnEventAsync(evt);