Пример #1
0
        public static DeclareAchievementType Create(int in_icon, string in_name, int in_type)
        {
            DeclareAchievementType tmp = new DeclareAchievementType();

            tmp._icon = in_icon;
            tmp._name = in_name;
            tmp._type = in_type;

            return(tmp);
        }
Пример #2
0
 public static void Convert(Dictionary <int, DeclareAchievementType> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareAchievementType.Create(748, StringDefines.Key_58323, 1));
     data.Add(2, DeclareAchievementType.Create(734, StringDefines.Key_58324, 2));
     data.Add(3, DeclareAchievementType.Create(1122, StringDefines.Key_58325, 3));
     data.Add(4, DeclareAchievementType.Create(1162, StringDefines.Key_58326, 4));
     data.Add(5, DeclareAchievementType.Create(890, StringDefines.Key_58327, 5));
     data.Add(6, DeclareAchievementType.Create(886, StringDefines.Key_58328, 6));
     data.Add(7, DeclareAchievementType.Create(727, StringDefines.Key_58329, 7));
     data.Add(8, DeclareAchievementType.Create(884, StringDefines.Key_58330, 8));
     data.Add(9, DeclareAchievementType.Create(738, StringDefines.Key_58331, 9));
     data.Add(10, DeclareAchievementType.Create(746, StringDefines.Key_58332, 10));
 }
Пример #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[]> >("DataAchievementType");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataAchievementType = require 'Lua/Config/DataAchievementType'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataAchievementType");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareAchievementType>(10);
                    foreach (var item in dic)
                    {
                        DeclareAchievementType tmp = new DeclareAchievementType();
                        tmp.Icon = item.Value[0];
                        tmp.Name = CfgStringLua.Get(item.Value[1]);
                        tmp.Type = item.Value[2];

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