protected void UnReg(uint msgId, BaseEvent.Callback cb) { for (int i = 0; i < mCBPairs.Count; ++i) { if (mCBPairs[i].ID == msgId && mCBPairs[i].CB == cb) { mCBPairs.RemoveAt(i); break; } } mDispatcher.UnReg(msgId, cb); }
protected void Reg(uint msgId, BaseEvent.Callback cb) { for (int i = 0; i < mCBPairs.Count; ++i) { if (mCBPairs[i].ID == msgId && mCBPairs[i].CB == cb) { return; } } MsgCBPair pair; pair.ID = msgId; pair.CB = cb; mCBPairs.Add(pair); mDispatcher.Reg(msgId, cb); }
public void RemoveEvent(EClientEvent uiEvitID, BaseEvent.Callback cb) { UnReg((uint)uiEvitID, cb); }
public void AddEvent(EClientEvent uiEvtID, BaseEvent.Callback callback) { Reg((uint)uiEvtID, callback); }