示例#1
0
 /// <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;
 }
示例#2
0
 /// <summary>
 /// Removes a OnDetectedDelegate
 /// See docs for AddOnDetectedDelegate()
 /// </summary>
 /// <param name="del"></param>
 public void RemoveOnNewDetectedDelegate(OnNewDetectedDelegate del)
 {
     this.onNewDetectedDelegates -= del;
 }
示例#3
0
        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;
        }