Exemplo n.º 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);
            };
        }
Exemplo n.º 2
0
 /// <inheritdoc />
 public LocalPlayerUnitFrameResourceUpdateEventListener(ILocalPlayerSpawnedEventSubscribable subscriptionService, [NotNull] IEntityDataChangeCallbackRegisterable entityDataCallbackRegister, [NotNull] IReadonlyLocalPlayerDetails playerDetails,
                                                        [NotNull][KeyFilter(UnityUIRegisterationKey.PlayerUnitFrame)] IUIUnitFrame playerUnitFrame)
     : base(subscriptionService)
 {
     EntityDataCallbackRegister = entityDataCallbackRegister ?? throw new ArgumentNullException(nameof(entityDataCallbackRegister));
     PlayerDetails   = playerDetails ?? throw new ArgumentNullException(nameof(playerDetails));
     PlayerUnitFrame = playerUnitFrame ?? throw new ArgumentNullException(nameof(playerUnitFrame));
 }
Exemplo n.º 3
0
 protected LocalPlayerTargetChangedEventListener(ILocalPlayerTargetChangedEventListener subscriptionService,
                                                 [NotNull] ILog logger,
                                                 [NotNull][KeyFilter(UnityUIRegisterationKey.TargetUnitFrame)] IUIUnitFrame targetUnitFrame)
     : base(subscriptionService)
 {
     TargetUnitFrame = targetUnitFrame ?? throw new ArgumentNullException(nameof(targetUnitFrame));
     Logger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemplo n.º 4
0
 public InitializeTargetNameEventListener(ILocalPlayerTargetChangedEventListener subscriptionService,
                                          ILog logger,
                                          [KeyFilter(UnityUIRegisterationKey.TargetUnitFrame)] IUIUnitFrame targetUnitFrame,
                                          [NotNull] IEntityNameQueryable nameQueryable)
     : base(subscriptionService, logger, targetUnitFrame)
 {
     NameQueryable = nameQueryable ?? throw new ArgumentNullException(nameof(nameQueryable));
 }
Exemplo n.º 5
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));
 }
Exemplo n.º 6
0
 public InitializeTargetResourcesEventListener(ILocalPlayerTargetChangedEventListener subscriptionService,
                                               ILog logger,
                                               [KeyFilter(UnityUIRegisterationKey.TargetUnitFrame)] IUIUnitFrame targetUnitFrame,
                                               [NotNull] IReadonlyEntityGuidMappable <IEntityDataFieldContainer> entityDataMappable,
                                               [NotNull] IEntityDataChangeCallbackRegisterable entityDataChangeCallbackService)
     : base(subscriptionService, logger, targetUnitFrame)
 {
     EntityDataMappable = entityDataMappable ?? throw new ArgumentNullException(nameof(entityDataMappable));
     EntityDataChangeCallbackService = entityDataChangeCallbackService ?? throw new ArgumentNullException(nameof(entityDataChangeCallbackService));
 }
Exemplo n.º 7
0
 /// <inheritdoc />
 public ClaimedGroupUnitFrame(IUIUnitFrame unitFrame)
 {
     UnitFrame       = unitFrame;
     Unregisterables = new List <IEntityDataEventUnregisterable>(5);
 }