Ejemplo n.º 1
0
        public static DeclareShengwuAttr Create(string in_attribute, int in_id, string in_name, int in_nocite, int in_progress, int in_skill, string in_up_item)
        {
            DeclareShengwuAttr tmp = new DeclareShengwuAttr();

            tmp._attribute = in_attribute;
            tmp._id        = in_id;
            tmp._name      = in_name;
            tmp._nocite    = in_nocite;
            tmp._progress  = in_progress;
            tmp._skill     = in_skill;
            tmp._up_item   = in_up_item;

            return(tmp);
        }
Ejemplo n.º 2
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[]> >("DataShengwuAttr");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataShengwuAttr = require 'Lua/Config/DataShengwuAttr'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataShengwuAttr");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareShengwuAttr>(400);
                    foreach (var item in dic)
                    {
                        DeclareShengwuAttr tmp = new DeclareShengwuAttr();
                        tmp.Attribute = CfgStringLua.Get(item.Value[0]);
                        tmp.Id        = item.Value[1];
                        tmp.Name      = CfgStringLua.Get(item.Value[2]);
                        tmp.Nocite    = item.Value[3];
                        tmp.Progress  = item.Value[4];
                        tmp.Skill     = item.Value[5];
                        tmp.UpItem    = CfgStringLua.Get(item.Value[6]);

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