public bool DelWatcher(Watcher watcher) { if (this.watchers.ContainsKey(watcher.event_identifier)) return this.watchers[watcher.event_identifier].Remove(watcher); else return false; }
public Watcher AddWatcher(string event_emitter, string event_identifier, Effect effect, Watcher.WatcherCondition condition) { Watcher watcher = new Watcher(event_emitter, event_identifier, effect, condition); if (this.watchers.ContainsKey(watcher.event_identifier)) this.watchers[watcher.event_identifier].Add(watcher); else { this.watchers[watcher.event_identifier] = new List<Watcher>(); this.watchers[watcher.event_identifier].Add(watcher); } return watcher; }