Beispiel #1
0
 public static void Convert(Dictionary <int, DeclareShenwuAddatt> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareShenwuAddatt.Create(StringDefines.Key_42159, 511, 1, 50081, StringDefines.Key_42160, 1));
     data.Add(2, DeclareShenwuAddatt.Create(StringDefines.Key_42161, 467, 2, 50082, StringDefines.Key_42160, 1));
     data.Add(3, DeclareShenwuAddatt.Create(StringDefines.Key_42162, 3284, 3, 50083, StringDefines.Key_42163, 1));
     data.Add(4, DeclareShenwuAddatt.Create(StringDefines.Key_42164, 423, 4, 50078, StringDefines.Key_42160, 2));
     data.Add(5, DeclareShenwuAddatt.Create(StringDefines.Key_42165, 555, 5, 50079, StringDefines.Key_42160, 2));
     data.Add(6, DeclareShenwuAddatt.Create(StringDefines.Key_42166, 3146, 6, 50080, StringDefines.Key_42163, 2));
     data.Add(7, DeclareShenwuAddatt.Create(StringDefines.Key_42167, 1086, 7, 50084, StringDefines.Key_42160, 3));
     data.Add(8, DeclareShenwuAddatt.Create(StringDefines.Key_42168, 1291, 8, 50085, StringDefines.Key_42160, 3));
     data.Add(9, DeclareShenwuAddatt.Create(StringDefines.Key_42169, 8014, 9, 50086, StringDefines.Key_42163, 3));
     data.Add(10, DeclareShenwuAddatt.Create(StringDefines.Key_42170, 442, 10, 50087, StringDefines.Key_42160, 4));
     data.Add(11, DeclareShenwuAddatt.Create(StringDefines.Key_42171, 542, 11, 50088, StringDefines.Key_42160, 4));
     data.Add(12, DeclareShenwuAddatt.Create(StringDefines.Key_42172, 3228, 12, 50089, StringDefines.Key_42163, 4));
     data.Add(13, DeclareShenwuAddatt.Create(StringDefines.Key_42173, 442, 13, 50104, StringDefines.Key_42160, 5));
     data.Add(14, DeclareShenwuAddatt.Create(StringDefines.Key_42174, 542, 14, 50105, StringDefines.Key_42160, 5));
     data.Add(15, DeclareShenwuAddatt.Create(StringDefines.Key_42175, 3228, 15, 50106, StringDefines.Key_42163, 5));
     data.Add(16, DeclareShenwuAddatt.Create(StringDefines.Key_42176, 442, 16, 50155, StringDefines.Key_42160, 6));
     data.Add(17, DeclareShenwuAddatt.Create(StringDefines.Key_42177, 542, 17, 50156, StringDefines.Key_42160, 6));
     data.Add(18, DeclareShenwuAddatt.Create(StringDefines.Key_42178, 3228, 18, 50157, StringDefines.Key_42163, 6));
 }
        public static DeclareShenwuAddatt Create(string in_attribute, int in_fightnum, int in_id, int in_item_id, string in_leve_limit, int in_type)
        {
            DeclareShenwuAddatt tmp = new DeclareShenwuAddatt();

            tmp._attribute  = in_attribute;
            tmp._fightnum   = in_fightnum;
            tmp._id         = in_id;
            tmp._item_id    = in_item_id;
            tmp._leve_limit = in_leve_limit;
            tmp._type       = in_type;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareShenwuAddatt>(18);
                    foreach (var item in dic)
                    {
                        DeclareShenwuAddatt tmp = new DeclareShenwuAddatt();
                        tmp.Attribute = CfgStringLua.Get(item.Value[0]);
                        tmp.Fightnum  = item.Value[1];
                        tmp.Id        = item.Value[2];
                        tmp.ItemId    = item.Value[3];
                        tmp.LeveLimit = CfgStringLua.Get(item.Value[4]);
                        tmp.Type      = item.Value[5];

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