public static DeclareGuildDonate Create(string in_coinType, string in_guild_get, int in_id, string in_own_get, string in_technology_get)
        {
            DeclareGuildDonate tmp = new DeclareGuildDonate();

            tmp._coinType       = in_coinType;
            tmp._guild_get      = in_guild_get;
            tmp._id             = in_id;
            tmp._own_get        = in_own_get;
            tmp._technology_get = in_technology_get;

            return(tmp);
        }
Exemple #2
0
 public static void Convert(Dictionary <int, DeclareGuildDonate> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareGuildDonate.Create(StringDefines.Key_3990, StringDefines.Key_31380, 1, StringDefines.Key_31381, StringDefines.Key_31382));
     data.Add(2, DeclareGuildDonate.Create(StringDefines.Key_12422, StringDefines.Key_31383, 2, StringDefines.Key_31384, StringDefines.Key_31385));
     data.Add(3, DeclareGuildDonate.Create(StringDefines.Key_28, StringDefines.Key_31386, 3, StringDefines.Key_31387, StringDefines.Key_31388));
     data.Add(4, DeclareGuildDonate.Create(StringDefines.Key_13611, StringDefines.Key_31389, 4, StringDefines.Key_31390, StringDefines.Key_31391));
 }
        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[]> >("DataGuildDonate");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataGuildDonate = require 'Lua/Config/DataGuildDonate'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataGuildDonate");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareGuildDonate>(4);
                    foreach (var item in dic)
                    {
                        DeclareGuildDonate tmp = new DeclareGuildDonate();
                        tmp.CoinType      = CfgStringLua.Get(item.Value[0]);
                        tmp.GuildGet      = CfgStringLua.Get(item.Value[1]);
                        tmp.Id            = item.Value[2];
                        tmp.OwnGet        = CfgStringLua.Get(item.Value[3]);
                        tmp.TechnologyGet = CfgStringLua.Get(item.Value[4]);

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