public static DeclareFriendIntimacy Create(int in_bUFFID, int in_id)
        {
            DeclareFriendIntimacy tmp = new DeclareFriendIntimacy();

            tmp._bUFFID = in_bUFFID;
            tmp._id     = in_id;

            return(tmp);
        }
Exemple #2
0
 public static void Convert(Dictionary <int, DeclareFriendIntimacy> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1000, DeclareFriendIntimacy.Create(1001, 1000));
     data.Add(2000, DeclareFriendIntimacy.Create(1002, 2000));
     data.Add(5000, DeclareFriendIntimacy.Create(1003, 5000));
     data.Add(7000, DeclareFriendIntimacy.Create(1004, 7000));
     data.Add(10000, DeclareFriendIntimacy.Create(1005, 10000));
 }
        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[]> >("DataFriendIntimacy");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataFriendIntimacy = require 'Lua/Config/DataFriendIntimacy'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataFriendIntimacy");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareFriendIntimacy>(5);
                    foreach (var item in dic)
                    {
                        DeclareFriendIntimacy tmp = new DeclareFriendIntimacy();
                        tmp.BUFFID = item.Value[0];
                        tmp.Id     = item.Value[1];

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