예제 #1
0
 public static void Convert(Dictionary <int, DeclareMarriageCost> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareMarriageCost.Create(1, 1, StringDefines.Key_20, 200, StringDefines.Key_20054, StringDefines.Key_20055, StringDefines.Key_20056, StringDefines.Key_20, 1));
     data.Add(2, DeclareMarriageCost.Create(2, 2, StringDefines.Key_20, 200, StringDefines.Key_20054, StringDefines.Key_20057, StringDefines.Key_20058, StringDefines.Key_20059, 2));
     data.Add(3, DeclareMarriageCost.Create(3, 3, StringDefines.Key_20060, 200, StringDefines.Key_20061, StringDefines.Key_20062, StringDefines.Key_20063, StringDefines.Key_20059, 3));
 }
예제 #2
0
        public static DeclareMarriageCost Create(int in_dinner, int in_effectID, string in_fashion, int in_friends, string in_mold, string in_name, string in_need_type, string in_rewardItemList, int in_type)
        {
            DeclareMarriageCost tmp = new DeclareMarriageCost();

            tmp._dinner         = in_dinner;
            tmp._effectID       = in_effectID;
            tmp._fashion        = in_fashion;
            tmp._friends        = in_friends;
            tmp._mold           = in_mold;
            tmp._name           = in_name;
            tmp._need_type      = in_need_type;
            tmp._rewardItemList = in_rewardItemList;
            tmp._type           = in_type;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareMarriageCost>(3);
                    foreach (var item in dic)
                    {
                        DeclareMarriageCost tmp = new DeclareMarriageCost();
                        tmp.Dinner         = item.Value[0];
                        tmp.EffectID       = item.Value[1];
                        tmp.Fashion        = CfgStringLua.Get(item.Value[2]);
                        tmp.Friends        = item.Value[3];
                        tmp.Mold           = CfgStringLua.Get(item.Value[4]);
                        tmp.Name           = CfgStringLua.Get(item.Value[5]);
                        tmp.NeedType       = CfgStringLua.Get(item.Value[6]);
                        tmp.RewardItemList = CfgStringLua.Get(item.Value[7]);
                        tmp.Type           = item.Value[8];

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