コード例 #1
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[]> >("DataActiveRune");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataActiveRune = require 'Lua/Config/DataActiveRune'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataActiveRune");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareActiveRune>();
                    foreach (var item in dic)
                    {
                        DeclareActiveRune tmp = new DeclareActiveRune();
                        tmp.Att          = CfgStringLua.Get(item.Value[0]);
                        tmp.CritGet      = item.Value[1];
                        tmp.CritPer      = item.Value[2];
                        tmp.DecGold      = item.Value[3];
                        tmp.EachAdd      = item.Value[4];
                        tmp.EachCount    = item.Value[5];
                        tmp.Icon         = item.Value[6];
                        tmp.Id           = item.Value[7];
                        tmp.Level        = item.Value[8];
                        tmp.LimitDecGold = item.Value[9];
                        tmp.Name         = CfgStringLua.Get(item.Value[10]);
                        tmp.Need         = item.Value[11];
                        tmp.NormalGet    = item.Value[12];
                        tmp.Rune         = item.Value[13];
                        tmp.SuperGet     = item.Value[14];
                        tmp.SuperPer     = item.Value[15];
                        tmp.UpNeedExp    = item.Value[16];

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "ActiveRune");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclareActiveRune>();
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "ActiveRune");
                }
            }
        }
コード例 #2
0
        public static DeclareActiveRune Create(string in_att, int in_critGet, int in_critPer, int in_decGold, int in_eachAdd, int in_eachCount, int in_icon, int in_id, int in_level, int in_limitDecGold, string in_name, int in_need, int in_normalGet, int in_rune, int in_superGet, int in_superPer, int in_upNeedExp)
        {
            DeclareActiveRune tmp = new DeclareActiveRune();

            tmp._att          = in_att;
            tmp._critGet      = in_critGet;
            tmp._critPer      = in_critPer;
            tmp._decGold      = in_decGold;
            tmp._eachAdd      = in_eachAdd;
            tmp._eachCount    = in_eachCount;
            tmp._icon         = in_icon;
            tmp._id           = in_id;
            tmp._level        = in_level;
            tmp._limitDecGold = in_limitDecGold;
            tmp._name         = in_name;
            tmp._need         = in_need;
            tmp._normalGet    = in_normalGet;
            tmp._rune         = in_rune;
            tmp._superGet     = in_superGet;
            tmp._superPer     = in_superPer;
            tmp._upNeedExp    = in_upNeedExp;

            return(tmp);
        }