public static void Convert(Dictionary <int, DeclarePhotoFilter> data) { if (data == null) { return; } data.Clear(); data.Add(1, DeclarePhotoFilter.Create(1, 100, 4, 1, 90, StringDefines.Key_56717, 30)); data.Add(2, DeclarePhotoFilter.Create(1, 300, 4, 2, 75, StringDefines.Key_56718, 3)); data.Add(3, DeclarePhotoFilter.Create(1, 352, 4, 3, 44, StringDefines.Key_56719, 15)); data.Add(4, DeclarePhotoFilter.Create(1, 219, 4, 4, 114, StringDefines.Key_56720, 45)); data.Add(5, DeclarePhotoFilter.Create(1, 300, 4, 5, 245, StringDefines.Key_56721, 55)); }
public static DeclarePhotoFilter Create(int in_blurIterations, int in_blurSize, int in_downSampleFactor, int in_id, int in_intensity, string in_name, int in_threshhold) { DeclarePhotoFilter tmp = new DeclarePhotoFilter(); tmp._blurIterations = in_blurIterations; tmp._blurSize = in_blurSize; tmp._downSampleFactor = in_downSampleFactor; tmp._id = in_id; tmp._intensity = in_intensity; tmp._name = in_name; tmp._threshhold = in_threshhold; return(tmp); }
public static void SetData() { if (_dataCaches == null && LuaEnv.isLoadLuaCfg) { long startTime = DateTime.Now.Ticks; Dictionary <int, int[]> dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataPhotoFilter"); if (dic == null) { LuaEnv.SharedLuaEnv.DoString("DataPhotoFilter = require 'Lua/Config/DataPhotoFilter'"); dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataPhotoFilter"); } if (dic != null) { _dataCaches = new Dictionary <int, DeclarePhotoFilter>(5); foreach (var item in dic) { DeclarePhotoFilter tmp = new DeclarePhotoFilter(); tmp.BlurIterations = item.Value[0]; tmp.BlurSize = item.Value[1]; tmp.DownSampleFactor = item.Value[2]; tmp.Id = item.Value[3]; tmp.Intensity = item.Value[4]; tmp.Name = CfgStringLua.Get(item.Value[5]); tmp.Threshhold = item.Value[6]; _dataCaches.Add(item.Key, tmp); } } Record(startTime, DateTime.Now.Ticks, "PhotoFilter"); } if (_dataCaches == null && _fillDataCallBack != null) { if (_dataCaches == null) { long startTime = DateTime.Now.Ticks; _dataCaches = new Dictionary <int, DeclarePhotoFilter>(5); _fillDataCallBack(_dataCaches); Record(startTime, DateTime.Now.Ticks, "PhotoFilter"); } } }