예제 #1
0
        public TargetUnitFrameUIControllerEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                                        IEntityDataChangeCallbackRegisterable entityDataCallbackRegister,
                                                        IReadonlyLocalPlayerDetails playerDetails,
                                                        [NotNull][KeyFilter(UnityUIRegisterationKey.TargetUnitFrame)] IUIUnitFrame targetUnitFrame,
                                                        [NotNull] ILog logger,
                                                        INetworkEntityVisibilityLostEventSubscribable networkVisibilityLostSubscriptionService,
                                                        [NotNull] IPeerPayloadSendService <GameClientPacketPayload> sendService)
            : base(subscriptionService, entityDataCallbackRegister, playerDetails)
        {
            TargetUnitFrame = targetUnitFrame ?? throw new ArgumentNullException(nameof(targetUnitFrame));
            Logger          = logger ?? throw new ArgumentNullException(nameof(logger));
            SendService     = sendService ?? throw new ArgumentNullException(nameof(sendService));

            //Subscribe to when the target actually disappears.
            networkVisibilityLostSubscriptionService.OnNetworkEntityVisibilityLost += (sender, args) =>
            {
                UnityAsyncHelper.UnityMainThreadContext.Post(o =>
                {
                    //This should be safe, we're checking if it was the current target still
                    //user may have clicked on something else but this should be safe this way.
                    if (args.EntityGuid == this.CurrentTarget)
                    {
                        OnPlayerTargetDisappeared();
                    }
                }, null);
            };
        }
 public InitializeClientLoadingPositionEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                                     [NotNull] GladMMOUnityClient client,
                                                     [NotNull] IReadonlyEntityGuidMappable <IMovementData> movementDataMappable)
     : base(subscriptionService)
 {
     Client = client ?? throw new ArgumentNullException(nameof(client));
     MovementDataMappable = movementDataMappable ?? throw new ArgumentNullException(nameof(movementDataMappable));
 }
예제 #3
0
 public InitializeDefaultLocalSpawnRequirementsEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                                             [NotNull] GladMMOUnityClient client,
                                                             [NotNull] ILocalCharacterDataRepository characterDataRepository)
     : base(subscriptionService)
 {
     Client = client ?? throw new ArgumentNullException(nameof(client));
     CharacterDataRepository = characterDataRepository ?? throw new ArgumentNullException(nameof(characterDataRepository));
 }
예제 #4
0
 /// <inheritdoc />
 protected DataChangedLocalPlayerSpawnedEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                                      [NotNull] IEntityDataChangeCallbackRegisterable entityDataCallbackRegister,
                                                      [NotNull] IReadonlyLocalPlayerDetails playerDetails)
     : base(subscriptionService)
 {
     EntityDataCallbackRegister = entityDataCallbackRegister ?? throw new ArgumentNullException(nameof(entityDataCallbackRegister));
     PlayerDetails = playerDetails ?? throw new ArgumentNullException(nameof(playerDetails));
 }
예제 #5
0
 /// <inheritdoc />
 public MovementInputBroadcastingTickable(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                          [NotNull] ILog logger,
                                          [NotNull] IMovementInputController inputController)
     : base(subscriptionService)
 {
     Logger          = logger ?? throw new ArgumentNullException(nameof(logger));
     InputController = inputController ?? throw new ArgumentNullException(nameof(inputController));
 }
예제 #6
0
 /// <inheritdoc />
 public LocalPlayerSpawnedLevelChangeEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                                   IEntityDataChangeCallbackRegisterable entityDataCallbackRegister,
                                                   IReadonlyLocalPlayerDetails playerDetails,
                                                   [KeyFilter(UnityUIRegisterationKey.PlayerUnitFrame)][NotNull]
                                                   IUIUnitFrame playerUnitFrame)
     : base(subscriptionService, entityDataCallbackRegister, playerDetails)
 {
     PlayerUnitFrame = playerUnitFrame ?? throw new ArgumentNullException(nameof(playerUnitFrame));
 }
예제 #7
0
 public InitializeExperienceBarEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                             IEntityDataChangeCallbackRegisterable entityDataCallbackRegister,
                                             IReadonlyLocalPlayerDetails playerDetails,
                                             [NotNull] IEntityExperienceLevelStrategy levelStrategy,
                                             [NotNull][KeyFilter(UnityUIRegisterationKey.ExperienceBar)] IUIFillableImage experienceBar)
     : base(subscriptionService, entityDataCallbackRegister, playerDetails)
 {
     LevelStrategy = levelStrategy ?? throw new ArgumentNullException(nameof(levelStrategy));
     ExperienceBar = experienceBar ?? throw new ArgumentNullException(nameof(experienceBar));
 }
예제 #8
0
		public RequestPlayerActionBarsEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
			[NotNull] ICharacterService characterService,
			[NotNull] IReadonlyLocalPlayerDetails playerDetails,
			[NotNull] IActionBarCollection actionBarCollection,
			[NotNull] IActionBarButtonStateChangedEventPublisher actionBarStateChangePublisher) 
			: base(subscriptionService)
		{
			CharacterService = characterService ?? throw new ArgumentNullException(nameof(characterService));
			PlayerDetails = playerDetails ?? throw new ArgumentNullException(nameof(playerDetails));
			ActionBarCollection = actionBarCollection ?? throw new ArgumentNullException(nameof(actionBarCollection));
			ActionBarStateChangePublisher = actionBarStateChangePublisher ?? throw new ArgumentNullException(nameof(actionBarStateChangePublisher));
		}
예제 #9
0
        public PositionalVoiceAudioGameTickable(IVoiceSessionAuthenticatedEventSubscribable subscriptionService,
                                                [NotNull] ILocalPlayerSpawnedEventSubscribable playerSpawnedSubscriptionService,
                                                [NotNull] PositionalVoiceEntityTickable positionalChannelUpdateTickable,
                                                [NotNull] INetworkClientDisconnectedEventSubscribable disconnectionEventSubscriptionService)
            : base(subscriptionService)
        {
            if (playerSpawnedSubscriptionService == null)
            {
                throw new ArgumentNullException(nameof(playerSpawnedSubscriptionService));
            }
            PositionalChannelUpdateTickable = positionalChannelUpdateTickable ?? throw new ArgumentNullException(nameof(positionalChannelUpdateTickable));

            playerSpawnedSubscriptionService.OnLocalPlayerSpawned             += OnLocalPlayerSpawnedEvent;
            disconnectionEventSubscriptionService.OnNetworkClientDisconnected += (o, e) => this.State = PositionalAudioState.Default;
        }
예제 #10
0
        public CameraInputBroadcastingTickable(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                               [NotNull] ILog logger,
                                               [NotNull] IFactoryCreatable <CameraInputData, EmptyFactoryContext> cameraInputDataFactory,
                                               [NotNull] ICameraInputController cameraInputController)
            : base(subscriptionService)
        {
            if (cameraInputDataFactory == null)
            {
                throw new ArgumentNullException(nameof(cameraInputDataFactory));
            }
            Logger = logger ?? throw new ArgumentNullException(nameof(logger));
            CameraInputController = cameraInputController ?? throw new ArgumentNullException(nameof(cameraInputController));

            Data = new Lazy <CameraInputData>(() => cameraInputDataFactory.Create(EmptyFactoryContext.Instance));
        }
예제 #11
0
 public InitializeRealtimeSocialServiceEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                                     [NotNull] ILog logger,
                                                     [NotNull] IServiceDiscoveryService serviceDiscoveryService,
                                                     [NotNull] ILocalPlayerDetails playerDetails,
                                                     [NotNull] IReadonlyAuthTokenRepository authTokenProvider,
                                                     [NotNull] IRemoteSocialHubClient remoteSocialClient,
                                                     [NotNull] IEnumerable <IConnectionHubInitializable> connectionHubInitializable)
     : base(subscriptionService)
 {
     Logger = logger ?? throw new ArgumentNullException(nameof(logger));
     ServiceDiscoveryService    = serviceDiscoveryService ?? throw new ArgumentNullException(nameof(serviceDiscoveryService));
     PlayerDetails              = playerDetails ?? throw new ArgumentNullException(nameof(playerDetails));
     AuthTokenProvider          = authTokenProvider ?? throw new ArgumentNullException(nameof(authTokenProvider));
     RemoteSocialClient         = remoteSocialClient ?? throw new ArgumentNullException(nameof(remoteSocialClient));
     ConnectionHubInitializable = connectionHubInitializable ?? throw new ArgumentNullException(nameof(connectionHubInitializable));
 }
예제 #12
0
 public LocalPlayerSpawnedInitializeCameraMappableEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                                                [NotNull] IEntityGuidMappable <Camera> cameraMappable)
     : base(subscriptionService)
 {
     CameraMappable = cameraMappable ?? throw new ArgumentNullException(nameof(cameraMappable));
 }
예제 #13
0
 /// <inheritdoc />
 public LocalPlayerSpellCastingEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                             IEntityDataChangeCallbackRegisterable entityDataCallbackRegister,
                                             IReadonlyLocalPlayerDetails playerDetails)
     : base(subscriptionService, entityDataCallbackRegister, playerDetails)
 {
 }
예제 #14
0
 public InitializeLocalPlayerEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService,
                                           [NotNull] GladMMOUnityClient client)
     : base(subscriptionService)
 {
     Client = client ?? throw new ArgumentNullException(nameof(client));
 }