Exemplo n.º 1
0
 public static void Convert(Dictionary <int, DeclareRank> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareRank.Create(1, 0, StringDefines.Key_14957, 0, 0, StringDefines.Key_20));
     data.Add(2, DeclareRank.Create(2, 1, StringDefines.Key_34604, 1, 2, StringDefines.Key_34604));
     data.Add(3, DeclareRank.Create(3, 1, StringDefines.Key_34605, 1, 1, StringDefines.Key_34605));
     data.Add(4, DeclareRank.Create(4, 1, StringDefines.Key_14924, 1, 10, StringDefines.Key_34605));
     data.Add(5, DeclareRank.Create(5, 6, StringDefines.Key_34606, 1, 7, StringDefines.Key_34604));
     data.Add(6, DeclareRank.Create(6, 1, StringDefines.Key_14922, 1, 9, StringDefines.Key_34604));
     data.Add(7, DeclareRank.Create(7, 0, StringDefines.Key_14990, 0, 0, StringDefines.Key_20));
     data.Add(8, DeclareRank.Create(8, 1, StringDefines.Key_34607, 7, 41, StringDefines.Key_34604));
     data.Add(9, DeclareRank.Create(9, 1, StringDefines.Key_17591, 999, 42, StringDefines.Key_34604));
     data.Add(10, DeclareRank.Create(10, 1, StringDefines.Key_34608, 7, 43, StringDefines.Key_34604));
     data.Add(11, DeclareRank.Create(11, 1, StringDefines.Key_34609, 7, 44, StringDefines.Key_34604));
     data.Add(12, DeclareRank.Create(12, 1, StringDefines.Key_34610, 7, 45, StringDefines.Key_34604));
     data.Add(13, DeclareRank.Create(13, 0, StringDefines.Key_14882, 0, 0, StringDefines.Key_20));
     data.Add(14, DeclareRank.Create(14, 1, StringDefines.Key_34611, 13, 8, StringDefines.Key_34605));
     data.Add(15, DeclareRank.Create(15, 0, StringDefines.Key_18687, 0, 0, StringDefines.Key_20));
     data.Add(16, DeclareRank.Create(16, 1, StringDefines.Key_15068, 15, 12, StringDefines.Key_34604));
     data.Add(17, DeclareRank.Create(17, 1, StringDefines.Key_14937, 15, 11, StringDefines.Key_34604));
     data.Add(18, DeclareRank.Create(18, 1, StringDefines.Key_14934, 15, 18, StringDefines.Key_34612));
     data.Add(19, DeclareRank.Create(19, 0, StringDefines.Key_34613, 0, 0, StringDefines.Key_20));
     data.Add(20, DeclareRank.Create(20, 3, StringDefines.Key_34614, 19, 13, StringDefines.Key_34604));
     data.Add(21, DeclareRank.Create(21, 2, StringDefines.Key_34615, 19, 14, StringDefines.Key_34604));
     data.Add(22, DeclareRank.Create(22, 5, StringDefines.Key_34616, 19, 15, StringDefines.Key_34604));
     data.Add(23, DeclareRank.Create(23, 4, StringDefines.Key_14872, 19, 16, StringDefines.Key_34604));
     data.Add(24, DeclareRank.Create(24, 1, StringDefines.Key_14921, 19, 17, StringDefines.Key_34604));
 }
Exemplo n.º 2
0
        public static DeclareRank Create(int in_id, int in_modelType, string in_name, int in_parent, int in_serverEnum, string in_uiValueDes)
        {
            DeclareRank tmp = new DeclareRank();

            tmp._id         = in_id;
            tmp._modelType  = in_modelType;
            tmp._name       = in_name;
            tmp._parent     = in_parent;
            tmp._serverEnum = in_serverEnum;
            tmp._uiValueDes = in_uiValueDes;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareRank>(24);
                    foreach (var item in dic)
                    {
                        DeclareRank tmp = new DeclareRank();
                        tmp.Id         = item.Value[0];
                        tmp.ModelType  = item.Value[1];
                        tmp.Name       = CfgStringLua.Get(item.Value[2]);
                        tmp.Parent     = item.Value[3];
                        tmp.ServerEnum = item.Value[4];
                        tmp.UiValueDes = CfgStringLua.Get(item.Value[5]);

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