public void ReInitialize() { this.Cleanup(); this.stateSubscriptionStorage = new StateSubscriptionStorage(); var groupPublicState = LandClaimAreasGroup.GetPublicState(this.areasGroup); groupPublicState.ClientSubscribe( o => o.LastRaidTime, this.RefreshRaidedState, this.stateSubscriptionStorage); this.RefreshRaidedState(); }
public Controller( ILogicObject areasGroup, WorldMapController worldMapController) { this.areasGroup = areasGroup; this.worldMapController = worldMapController; this.stateSubscriptionStorage = new StateSubscriptionStorage(); var groupPublicState = LandClaimAreasGroup.GetPublicState(areasGroup); groupPublicState.ClientSubscribe( o => o.LastRaidTime, this.RefreshRaidedState, this.stateSubscriptionStorage); this.RefreshRaidedState(); }
protected override void OnEnable() { this.Reset(); this.subscriptionStorage = new StateSubscriptionStorage(); this.characterPrivateState = ClientCurrentCharacterHelper.PrivateState; this.characterPrivateState.ClientSubscribe(_ => _.LastDismountedVehicleMapMark, _ => this.Refresh(), this.subscriptionStorage); this.characterPublicState = ClientCurrentCharacterHelper.PublicState; this.characterPublicState.ClientSubscribe(_ => _.CurrentVehicle, _ => this.Refresh(), this.subscriptionStorage); this.Refresh(); }
private void Reset() { this.subscriptionStorage?.Dispose(); this.subscriptionStorage = null; this.RemoveMarker(); }