Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="flag"></param>
 /// <param name="hookBundle"></param>
 /// <param name="unitsAlerted"></param>
 public void FlagDelegate(DelegateFlags flag, HookBundle hookBundle, List <Unit> unitsAlerted)
 {
     foreach (Unit unit in unitsAlerted)
     {
         unit.ExecuteDelegates(flag, hookBundle);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Searches for all hook functions of a given delegate flag, and executes their logic.
 /// </summary>
 /// <param name="flag">The delegate flag to search for.</param>
 /// <param name="hookBundle">The hook bundle to pass into the hook functions.</param>
 public void ExecuteDelegates(DelegateFlags flag, HookBundle hookBundle)
 {
     foreach (HookFunction hookFunction in hookFunctions.Values)
     {
         if (hookFunction.GetDelegateType() == flag)
         {
             hookFunction.ExecuteFunction(hookBundle);
         }
     }
 }
Ejemplo n.º 3
0
 public IAsyncResult BeginFlags(int messageOrdinal, AsyncCallback callback)
 {
     this._delegateFlags = this.Flags;
     return this._delegateFlags.BeginInvoke(messageOrdinal, callback, this._delegateFlags);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructor to initialize all instance variables.
 /// </summary>
 /// <param name="delegateType">The HookFunction's <see cref="delegateType"/>.</param>
 /// <param name="returnLogic">The HookFunction's <see cref="returnLogic"/>.</param>
 public HookFunction(string hookFunctionId, DelegateFlags delegateType, Func <HookBundle, object> returnLogic)
 {
     this.hookFunctionId = hookFunctionId;
     this.delegateType   = delegateType;
     this.returnLogic    = returnLogic;
 }