/// <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); } }
/// <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); } } }
public IAsyncResult BeginFlags(int messageOrdinal, AsyncCallback callback) { this._delegateFlags = this.Flags; return this._delegateFlags.BeginInvoke(messageOrdinal, callback, this._delegateFlags); }
/// <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; }