/// <summary> /// This replaces all older delegates rather than adding a new one to the list. /// See docs for AddOnNewDetectedDelegate() /// </summary> /// <param name="del"></param> public void SetOnNewDetectedDelegate(OnNewDetectedDelegate del) { this.onNewDetectedDelegates = del; }
/// <summary> /// Removes a OnDetectedDelegate /// See docs for AddOnDetectedDelegate() /// </summary> /// <param name="del"></param> public void RemoveOnNewDetectedDelegate(OnNewDetectedDelegate del) { this.onNewDetectedDelegates -= del; }
internal protected OnNewDetectedDelegate onNewDetectedDelegates; // Executed by Area /// <summary> /// Add a new delegate to be triggered when a target is first found by an Area. /// The delegate signature is: bool delegate(TargetTracker source, Target target) /// Return true to have no effect on the TargetTracker functioning /// Return false to cause the TargetTracker to ignore the new target entirely. /// **This will only allow a delegate to be added once.** /// </summary> /// <param name="del"></param> public void AddOnNewDetectedDelegate(OnNewDetectedDelegate del) { this.onNewDetectedDelegates -= del; // Cheap way to ensure unique (add only once) this.onNewDetectedDelegates += del; }