public void CreateCacheUtil(ECacheData type, object data, Action req, ushort rspID) { DataWrapper wrapper = new DataWrapper { _data = data, _req = req, _rspID = rspID, _notify = NotifyTypes.None }; this._cacheDataUtilDic.Add(type, wrapper); }
public void CheckCacheValidAndGo <T>(ECacheData type, NotifyTypes notify) where T : class { foreach (KeyValuePair <ECacheData, DataWrapper> pair in this._cacheDataUtilDic) { if (((ECacheData)pair.Key) == type) { CacheData <T> data = pair.Value._data as CacheData <T>; if (data.CacheValid) { Singleton <NotifyManager> .Instance.FireNotify(new Notify(notify, null)); return; } pair.Value._notify = notify; pair.Value._req(); } } }