/// <summary> /// 移除观察者 /// </summary> /// <param name="observer"></param> public void RemoveObserver(IMyObserver observer) { if (_observers.Contains(observer)) { _observers.Remove(observer); } }
public BaseCharacter(uint health, uint damage, IMyObserver observer) { _health = health; _maxHelth = health; _damage = damage; _observer = observer; }
//Also clients use this to unsubscribe themselves to no longer receive the messages. public Task UnSubscribe(IMyObserver observer) { if (_subsManager.IsSubscribed(observer)) { _subsManager.Unsubscribe(observer); } return(Task.CompletedTask); }
public Elf(IMyObserver observer) : base(200, 9, observer) { }
/// <summary> /// 注册观察者 /// </summary> /// <param name="observer"></param> public void RegisterObserver(IMyObserver observer) { _observers.Add(observer); }
public void RemoveObserver(IMyObserver observer) { _observers.Remove(observer); }
public void RegisterObserver(IMyObserver observer) { _observers.Add(observer); }
public void RegisterObserver(IMyObserver o) { observers.Add(o); }
public void Detach(IMyObserver observer) => Observers.Remove(observer);
public void Attach(IMyObserver observer) => Observers.Add(observer);
public void UnregisterObserver(IMyObserver i_DelObserver) { myObservers.Remove(i_DelObserver); }
public void RegisterObserver(IMyObserver i_NewObserver) { myObservers.Add(i_NewObserver); }
public Orc(IMyObserver observer) : base(120, 10, observer) { }
public Human(IMyObserver observer) : base(100, 8, observer) { }
protected Warrior(uint health, uint damage, IMyObserver observer) : base(health, damage, observer) { }
public void RemoveObserver(IMyObserver o) { var index = Observers.IndexOf(Observers.Where(x => (x as TeamDTO).Id == (o as TeamDTO).Id).FirstOrDefault()); Observers.RemoveAt(index); }
public void RemoveObserver(IMyObserver o) { observers.Remove(o); }