Пример #1
0
        public static DeclarePhotoAction Create(string in_action, int in_id, string in_name)
        {
            DeclarePhotoAction tmp = new DeclarePhotoAction();

            tmp._action = in_action;
            tmp._id     = in_id;
            tmp._name   = in_name;

            return(tmp);
        }
Пример #2
0
 public static void Convert(Dictionary <int, DeclarePhotoAction> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclarePhotoAction.Create(StringDefines.Key_20404, 1, StringDefines.Key_20405));
     data.Add(2, DeclarePhotoAction.Create(StringDefines.Key_20404, 2, StringDefines.Key_20405));
     data.Add(3, DeclarePhotoAction.Create(StringDefines.Key_20404, 3, StringDefines.Key_20405));
     data.Add(4, DeclarePhotoAction.Create(StringDefines.Key_20404, 4, StringDefines.Key_20405));
     data.Add(5, DeclarePhotoAction.Create(StringDefines.Key_20404, 5, StringDefines.Key_20405));
     data.Add(6, DeclarePhotoAction.Create(StringDefines.Key_20404, 6, StringDefines.Key_20405));
 }
Пример #3
0
        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[]> >("DataPhotoAction");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataPhotoAction = require 'Lua/Config/DataPhotoAction'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataPhotoAction");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclarePhotoAction>(6);
                    foreach (var item in dic)
                    {
                        DeclarePhotoAction tmp = new DeclarePhotoAction();
                        tmp.Action = CfgStringLua.Get(item.Value[0]);
                        tmp.Id     = item.Value[1];
                        tmp.Name   = CfgStringLua.Get(item.Value[2]);

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "PhotoAction");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclarePhotoAction>(6);
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "PhotoAction");
                }
            }
        }