public virtual void InitModular()
        {
            mCreaterByAttributes   = new List <ModularNoticeCreater>();
            mDecoraterByAttributes = new List <ModularNoticeDecorater>();
            mListenerByAttributes  = new List <ModularNoticeListener>();
            mModularNotifierMapper = new KeyValueList <Action <INoticeBase <int> >, ModularNotifier>();

            if (NoticeCreates == default)
            {
                NoticeCreates = new ModularNoticeCreater[0];
            }
            else
            {
            }

            if (NoticeDecoraters == default)
            {
                NoticeDecoraters = new ModularNoticeDecorater[0];
            }
            else
            {
            }

            if (NoticeListeners == default)
            {
                NoticeListeners = new ModularNoticeListener[0];
            }
            else
            {
            }

            InitCustomHandlers();

            GenerateModularHandlers();
        }
Beispiel #2
0
 /// <summary>修饰化模块生产处理方法的修改器</summary>
 private CreatorHandler OnSetCreator(CreatorHandler a, ModularNoticeCreater b, bool isAdd)
 {
     if (isAdd)
     {
         a += b.Handler;
     }
     else
     {
         a -= b.Handler;
     }
     return(a);
 }
Beispiel #3
0
 /// <summary>修饰化模块生产处理方法的获取器</summary>
 private CreatorHandler OnGetCreator(ModularNoticeCreater param)
 {
     return(param.Handler);
 }
Beispiel #4
0
 /// <summary>
 /// 添加消息生成器函数
 /// </summary>
 /// <param name="noticeName"></param>
 /// <param name="method"></param>
 public void AddNoticeCreater(ModularNoticeCreater target, bool willSort = false)
 {
     mCreators.AddHandler(ref target, willSort);
 }