Esempio n. 1
0
        public static DeclareGuildCollege Create(int in_iCON, int in_id, string in_learning_consumption, int in_level, string in_needLevel, int in_next_level_ID, int in_research_consumption, int in_research_time, int in_type)
        {
            DeclareGuildCollege tmp = new DeclareGuildCollege();

            tmp._iCON = in_iCON;
            tmp._id   = in_id;
            tmp._learning_consumption = in_learning_consumption;
            tmp._level                = in_level;
            tmp._needLevel            = in_needLevel;
            tmp._next_level_ID        = in_next_level_ID;
            tmp._research_consumption = in_research_consumption;
            tmp._research_time        = in_research_time;
            tmp._type = in_type;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareGuildCollege>(505);
                    foreach (var item in dic)
                    {
                        DeclareGuildCollege tmp = new DeclareGuildCollege();
                        tmp.ICON = item.Value[0];
                        tmp.Id   = item.Value[1];
                        tmp.LearningConsumption = CfgStringLua.Get(item.Value[2]);
                        tmp.Level               = item.Value[3];
                        tmp.NeedLevel           = CfgStringLua.Get(item.Value[4]);
                        tmp.NextLevelID         = item.Value[5];
                        tmp.ResearchConsumption = item.Value[6];
                        tmp.ResearchTime        = item.Value[7];
                        tmp.Type = item.Value[8];

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