コード例 #1
0
ファイル: DeclarePetSeal.cs プロジェクト: chenxihan/record
        public static DeclarePetSeal Create(string in_sea_attribute, int in_sea_level, int in_sea_material, int in_skill)
        {
            DeclarePetSeal tmp = new DeclarePetSeal();

            tmp._sea_attribute = in_sea_attribute;
            tmp._sea_level     = in_sea_level;
            tmp._sea_material  = in_sea_material;
            tmp._skill         = in_skill;

            return(tmp);
        }
コード例 #2
0
ファイル: DeclarePetSeal.cs プロジェクト: chenxihan/record
        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[]> >("DataPetSeal");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataPetSeal = require 'Lua/Config/DataPetSeal'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataPetSeal");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclarePetSeal>(1000);
                    foreach (var item in dic)
                    {
                        DeclarePetSeal tmp = new DeclarePetSeal();
                        tmp.SeaAttribute = CfgStringLua.Get(item.Value[0]);
                        tmp.SeaLevel     = item.Value[1];
                        tmp.SeaMaterial  = item.Value[2];
                        tmp.Skill        = item.Value[3];

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