public void DoRemove_Listener(OnChainData OnNotify) { if (_mapDelegate_And_HasOrderInstance.ContainsKey(OnNotify) == false) { return; } Data_HasOrder <OnChainData> pDeleagateInstance = _mapDelegate_And_HasOrderInstance[OnNotify]; _mapDelegate_And_HasOrderInstance.Remove(OnNotify); _listListener.Remove(pDeleagateInstance); }
public void DoNotify_ForDebug(TChainData arg) { TChainData pOrigin = arg; for (int i = 0; i < _listListener.Count; i++) { Data_HasOrder <OnChainData> data_HasOrder = _listListener[i]; data_HasOrder.TData(pOrigin, ref arg); Debug.Log(data_HasOrder.TData.Method.Name + "Call Order : " + i + " Origin : " + pOrigin + " Current : " + arg); } _LastChainData_Origin = pOrigin; _LastChainData_Current = arg; }
public void DoRegist_Listener(OnChainData OnNotify, int iOrder) { if (OnNotify == null || _mapDelegate_And_HasOrderInstance.ContainsKey(OnNotify)) { return; } Data_HasOrder <OnChainData> pDeleagateInstance = new Data_HasOrder <OnChainData>(OnNotify, iOrder); _mapDelegate_And_HasOrderInstance.Add(OnNotify, pDeleagateInstance); _listListener.Add(pDeleagateInstance); _listListener.Sort(Data_HasOrder <OnChainData> .Compare_Data_HasOrder); }
static public int Compare_Data_HasOrder(Data_HasOrder <T> x, Data_HasOrder <T> y) { return(x.iSortOrder.CompareTo(y.iSortOrder)); }