public void RegisterModuleEvent(IEventListener eventListener) { eventListener.RegisterEvent(); GameEventMap eMap = eventListener.GetEventMap(); if (eMap == null) { return; } foreach (int key in eMap.GetEventMap().Keys) { if (!mEventKeyMap.ContainsKey(key)) { mEventKeyMap[key] = new List <ModuleEventEntry>(); } ModuleEventEntry eventEntry = new ModuleEventEntry(); eventEntry.callback = eMap.GetEventDlgByKey(key); eventEntry.module = eventListener; mEventKeyMap[key].Add(eventEntry); } }