예제 #1
0
        public static DeclareElvesRunestar Create(string in_addAttribute, int in_gold_num, int in_id, int in_item_num, int in_up_item)
        {
            DeclareElvesRunestar tmp = new DeclareElvesRunestar();

            tmp._addAttribute = in_addAttribute;
            tmp._gold_num     = in_gold_num;
            tmp._id           = in_id;
            tmp._item_num     = in_item_num;
            tmp._up_item      = in_up_item;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareElvesRunestar>(660);
                    foreach (var item in dic)
                    {
                        DeclareElvesRunestar tmp = new DeclareElvesRunestar();
                        tmp.AddAttribute = CfgStringLua.Get(item.Value[0]);
                        tmp.GoldNum      = item.Value[1];
                        tmp.Id           = item.Value[2];
                        tmp.ItemNum      = item.Value[3];
                        tmp.UpItem       = item.Value[4];

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