public void Register(IObserver observer) { if (!Observers.Contains(observer)) { Observers.Add(observer); } }
public void Detach(IObserver observer) { if (Observers.Contains(observer)) { Observers.Remove(observer); } }
public void Unsubscribe(IObserver observer) { if (Observers.Contains(observer)) { this.Observers.Remove(observer); } }
public void Dispose() { if ((Observers != null) && Observers.Contains(Observer)) { Observers.Remove(Observer); } }
public void Dispose() { if (Observers.Contains(this.Observer)) { Observers.Remove(this.Observer); } }
public void RemoveObserver(Observer obs) { if (Observers.Contains(obs)) { Observers.Remove(obs); } }
public void Subscribe(IObserver observer) { if (!Observers.Contains(observer)) { Observers.Add(observer); } }
public virtual void SwitchToObserver() { if (Observers.Contains(Me)) { return; } RiotServices.GameService.SwitchPlayerToObserver(Data.Id); }
public void Dispose() { if (Observer != null && Observers.Contains(Observer)) { Observer.OnCompleted(); Observers.Remove(Observer); } }
public virtual void SwitchToPlayer(int team) { if (!Observers.Contains(Me)) { return; } RiotServices.GameService.SwitchObserverToPlayer(Data.Id, team); }
///-------------------------------------------------------------------- /// Interest Point methods ///-------------------------------------------------------------------- public IDisposable Subscribe(IObserver <bool> observer) { if (!Observers.Contains(observer)) { Observers.Add(observer); } return(new Unsubscriber <IObserver <bool> >(Observers, observer)); }
public IDisposable Subscribe(IObserver <Payload> observer) { if (!Observers.Contains(observer)) { Observers.Add(observer); } return(new ObservationState(Observers, observer)); }
public void Dispose() { if (Observer != null && Observers.Contains(Observer)) { Observers.Remove(Observer); _observer = null; } _observers = null; }
public bool ContainsObserver <V>(V observer) where V : IObserveComponent <T> { if (!isInitialized) { Debug.LogAssertion(NotYetObservingMessage); } return(Observers.Contains(observer)); }
public void AddObserver(T observer) { if (!Observers.Contains(observer)) { Observers.Add(observer); } //else // UnityEngine.Debug.LogFormat("Doubled observer: [{0}] - [{1}]", Target, observer); }
public IDisposable Subscribe(IObserver <IWorld> observer) { if (!Observers.Contains(observer)) { Observers.Add(observer); NotifyNewGeneration(); } return(new Unsubscriber(Observers, observer)); }
public IDisposable Subscribe(IObserver <Observation> observer) { if (!Observers.Contains(observer)) { Observers.Add(observer); foreach (var item in Observations) { observer.OnNext(item); } } return(new Unsubscriber(Observers, observer)); }
public virtual IDisposable Subscribe(IObserver <object> observer) { if (!Observers.Contains(observer)) { Observers.Add(observer); foreach (var value in Values) { observer.OnNext(value); } } return(new Unsubscriber <object>(Observers, observer)); }
public override IDisposable Subscribe(IObserver <ABus> observer) { // Check whether observer is already registered. If not, add it if (!Observers.Contains(observer)) { Observers.Add(observer); // Provide observer with existing data. foreach (var bus in Busses) { observer.OnNext(bus); } } return(new Unsubscriber <ABus>(observers, observer)); }
private void Unsubscribe(IObserver <T> observer) { if (!Observers.Contains(observer)) { return; } Observers.Remove(observer); observer.OnCompleted(); if (Observers.Count == 0) { if (_internalSubscription != null) { _internalSubscription.Dispose(); } if (_subscribeSubscription != null) { _subscribeSubscription.Dispose(); } } }
private int RefreshObservers() { Observers.PurgeDestroyed(); var refreshItems = this.GetComponents <IOutfitObserver>(); var count = 0; if (refreshItems.Length > 0) { // Add new items to end. foreach (var refreshItem in refreshItems) { if (!Observers.Contains(refreshItem)) { Observers.Add(refreshItem); count++; } } } return(count); }
public bool ContainsObserver(T target) { return(Observers.Contains(target)); }