Ejemplo n.º 1
0
        /**
         * @brief 提取数据
         *
         * @param node
         *
         * @return
         */
        public bool CollectDataFromDBC(DBC_Row node)
        {
            ImpactId          = DBCUtil.ExtractNumeric <int>(node, "Id", -1, true);
            ImpactLogicId     = DBCUtil.ExtractNumeric <int>(node, "LogicId", -1, true);
            ImpactGfxLogicId  = DBCUtil.ExtractNumeric <int>(node, "GfxLogicId", -1, true);
            ImpactDescription = DBCUtil.ExtractString(node, "Description", "", false);
            ImpactType        = DBCUtil.ExtractNumeric <int>(node, "ImpactType", -1, true);
            BreakSuperArmor   = DBCUtil.ExtractBool(node, "BreakSuperArmor", false, false);
            BreakParry        = DBCUtil.ExtractBool(node, "BreakParry", false, false);
            IgnoreBlock       = DBCUtil.ExtractBool(node, "IgnoreBlock", true, false);
            TargetFigure      = DBCUtil.ExtractNumericList <int>(node, "TargetFigure", 0, false);
            ImpactTime        = DBCUtil.ExtractNumeric <int>(node, "ImpactTime", -1, false);
            BuffDataId        = DBCUtil.ExtractNumeric <int>(node, "BuffDataId", -1, false);
            MaxRank           = DBCUtil.ExtractNumeric <int>(node, "MaxRank", -1, false);
            AnimationInfo     = DBCUtil.ExtractString(node, "AnimationInfo", "", false);
            LockFrameInfo     = DBCUtil.ExtractString(node, "LockFrameInfo", "", false);
            CurveMoveInfo     = DBCUtil.ExtractString(node, "CurveMove", "", false);
            MoveMode          = DBCUtil.ExtractNumeric <int>(node, "MoveMode", -1, false);
            AdjustPoint       = DBCUtil.ExtractString(node, "AdjustPoint", "", false);
            AdjustAppend      = DBCUtil.ExtractNumeric <float>(node, "AdjustAppend", 0.0f, false);
            AdjustDegreeXZ    = DBCUtil.ExtractNumeric <float>(node, "AdjustDegreeXZ", 0.0f, false);
            AdjustDegreeY     = DBCUtil.ExtractNumeric <float>(node, "AdjustDegreeY", 0.0f, false);
            MaxDist           = DBCUtil.ExtractNumeric <float>(node, "MaxDist", 0.0f, false);
            DamageType        = DBCUtil.ExtractNumeric <int>(node, "DamageType", 0, false);
            ElementType       = DBCUtil.ExtractNumeric <int>(node, "ElementType", 0, false);
            DamageValue       = DBCUtil.ExtractNumeric <int>(node, "DamageValue", 0, false);
            DamageRate        = DBCUtil.ExtractNumeric <float>(node, "DamageRate", 1.0f, false);
            LevelRate         = DBCUtil.ExtractNumeric <float>(node, "LevelRate", 0.0f, false);
            IsDeadDisappear   = DBCUtil.ExtractBool(node, "IsDeadDisappear", false, false);
            CanBeCancel       = DBCUtil.ExtractBool(node, "CanBeCancel", false, false);
            IsAbsorbHurt      = DBCUtil.ExtractBool(node, "IsAbsorbHurt", false, false);
            IsReflect         = DBCUtil.ExtractBool(node, "IsReflect", false, false);
            FallDownTime      = DBCUtil.ExtractNumeric <float>(node, "FallDownTime", -1.0f, false);
            OnGroundTime      = DBCUtil.ExtractNumeric <float>(node, "OnGroundTime", 0.3f, false);
            GetUpTime         = DBCUtil.ExtractNumeric <float>(node, "GetUpTime", -1.0f, false);
            IsDamageDisappear = DBCUtil.ExtractBool(node, "IsDamageDisappear", false, false);
            IsFightDisappear  = DBCUtil.ExtractBool(node, "IsFightDisappear", false, false);
            IsShootDisappear  = DBCUtil.ExtractBool(node, "IsShootDisappear", false, false);
            IsSkillDisappear  = DBCUtil.ExtractBool(node, "IsSkillDisappear", false, false);
            HitSoundProb      = DBCUtil.ExtractNumeric <float>(node, "HitSoundProb", 0.1f, false);

            for (int i = 0; i < EffectCount; ++i)
            {
                string key = "Effect" + i.ToString();
                EffectList.Add(Converter.ConvertNumericList <int>(DBCUtil.ExtractString(node, key, "", false)));
            }
            ActionList = DBCUtil.ExtractNumericList <int>(node, "AnimationType", 0, false);
            ParamNum   = DBCUtil.ExtractNumeric <int>(node, "ParamNum", 0, false);
            ExtraParams.Clear();
            if (ParamNum > 0)
            {
                for (int i = 0; i < ParamNum; ++i)
                {
                    string key = "Param" + i.ToString();
                    ExtraParams.Insert(i, DBCUtil.ExtractString(node, key, "", false));
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_TotalPoint = DBCUtil.ExtractNumeric <int>(node, "TotalPoint", 0, true);
     m_HighRate   = DBCUtil.ExtractNumeric <float>(node, "HighRate", 0.0f, true);
     m_LowRate    = DBCUtil.ExtractNumeric <float>(node, "LowRate", 0.0f, true);
     return(true);
 }
Ejemplo n.º 3
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     Id        = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
     Describe  = DBCUtil.ExtractString(node, "Describe", "", false);
     SkillList = DBCUtil.ExtractNumericList <int>(node, "SkillCombo", 0, false);
     return(true);
 }
Ejemplo n.º 4
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_BuyCount  = DBCUtil.ExtractNumeric <int>(node, "BuyCount", 0, true);
     m_CostGold  = DBCUtil.ExtractNumeric <int>(node, "CostGold", 0, true);
     m_GainMoney = DBCUtil.ExtractNumeric <int>(node, "GainMoney", 0, true);
     return(true);
 }
Ejemplo n.º 5
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_Id          = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
     m_Description = DBCUtil.ExtractString(node, "Description", "", false);
     m_AttrData.CollectDataFromDBC(node);
     return(true);
 }
Ejemplo n.º 6
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     Id             = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
     Name           = DBCUtil.ExtractString(node, "Name", "", false);
     Story          = DBCUtil.ExtractString(node, "Story", "", false);
     LinkId         = DBCUtil.ExtractNumeric <int>(node, "LinkId", 0, false);
     PartnerFragId  = DBCUtil.ExtractNumeric <int>(node, "PartnerFragId", 0, false);
     PartnerFragNum = DBCUtil.ExtractNumeric <int>(node, "PartnerFragNum", 0, false);
     InheritAttackAttrPercentList  = DBCUtil.ExtractNumericList <float>(node, "InheritAttackAttrPercent", 0.0f, false);
     InheritDefenceAttrPercentList = DBCUtil.ExtractNumericList <float>(node, "InheritDefenseAttrPercent", 0.0f, false);
     BornSkill       = DBCUtil.ExtractNumeric <int>(node, "BornSkill", -1, false);
     MaxImproveLevel = DBCUtil.ExtractNumeric <int>(node, "MaxImproveLevel", 0, false);
     AttrAppendList  = DBCUtil.ExtractNumericList <int>(node, "AttrAppend", 0, false);
     CoolDown        = DBCUtil.ExtractNumeric <float>(node, "CoolDown", 0, false);
     Duration        = DBCUtil.ExtractNumeric <float>(node, "Duration", 0, false);
     for (int i = 0; i <= 3; ++i)
     {
         SkillList.Add(DBCUtil.ExtractNumericList <int>(node, "SkillList" + i, 0, false));
     }
     LevelUpItemId     = DBCUtil.ExtractNumeric <int>(node, "LevelUpItemId", 0, false);
     StageUpItemId     = DBCUtil.ExtractNumeric <int>(node, "StageUpItemId", 0, false);
     Ailogic           = DBCUtil.ExtractNumeric <int>(node, "AiLogicId", 0, false);
     AiParam           = DBCUtil.ExtractNumeric <int>(node, "AiParam", 0, false);
     AtlasPath         = DBCUtil.ExtractString(node, "AtlasPath", "", false);
     Icon0             = DBCUtil.ExtractString(node, "Icon0", "", false);
     Icon1             = DBCUtil.ExtractString(node, "Icon1", "", false);
     Icon2             = DBCUtil.ExtractString(node, "Icon2", "", false);
     Icon3             = DBCUtil.ExtractString(node, "Icon3", "", false);
     StageDescription0 = DBCUtil.ExtractString(node, "Desc0", "", false);
     StageDescription1 = DBCUtil.ExtractString(node, "Desc1", "", false);
     StageDescription2 = DBCUtil.ExtractString(node, "Desc2", "", false);
     StageDescription3 = DBCUtil.ExtractString(node, "Desc3", "", false);
     return(true);
 }
Ejemplo n.º 7
0
 public void CollectDataFromDBC(DBC_Row node)
 {
     m_AddHpMax       = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddHpMax", 0, false), out m_HpMaxType);
     m_AddHpRecover   = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddHpRecover", 0, false), out m_HpRecoverType);
     m_AddRageMax     = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddRageMax", 0, false), out m_HpMaxType);
     m_AddEpMax       = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddEpMax", 0, false), out m_EpMaxType);
     m_AddEpRecover   = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddEpRecover", 0, false), out m_EpRecoverType);
     m_AddAd          = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddAd", 0, false), out m_AdType);
     m_AddADp         = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddADp", 0, false), out m_ADpType);
     m_AddMDp         = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddMDp", 0, false), out m_MDpType);
     m_AddCri         = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddCri", 0, false), out m_CriType);
     m_AddPow         = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddPow", 0, false), out m_PowType);
     m_AddBackHitPow  = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddBackHitPow", 0, false), out m_BackHitPowType);
     m_AddCrackPow    = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddCrackPow", 0, false), out m_CrackPowType);
     m_AddSpd         = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddSpd", 0, false), out m_SpdType);
     m_AddWalkSpd     = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddWalkSpd", 0, false), out m_WalkSpdType);
     m_AddRunSpd      = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddSpd", 0, false), out m_RunSpdType);
     m_AddFireDam     = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddFireDam", 0, false), out m_FireDamType);
     m_AddFireErd     = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddFireErd", 0, false), out m_FireErdType);
     m_AddIceDam      = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddIceDam", 0, false), out m_IceDamType);
     m_AddIceErd      = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddIceErd", 0, false), out m_IceErdType);
     m_AddPoisonDam   = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddPoisonDam", 0, false), out m_PoisonDamType);
     m_AddPoisonErd   = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddPoisonErd", 0, false), out m_PoisonErdType);
     m_AddWeight      = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddWeight", 0, false), out m_WeightType);
     m_AddRps         = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddRps", 0, false), out m_RpsType);
     m_AddAttackRange = CalcRealValue(DBCUtil.ExtractNumeric <int>(node, "AddAttackRange", 0, false), out m_AttackRangeType);
 }
Ejemplo n.º 8
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_Index = DBCUtil.ExtractNumeric <int>(node, "Index", 0, true);
     m_Name  = DBCUtil.ExtractNumeric <string>(node, "Name", "", true);
     m_Value = DBCUtil.ExtractNumeric <int>(node, "Value", 0, true);
     return(true);
 }
Ejemplo n.º 9
0
        public void Init()
        {
            m_NpcInfos.Clear();
            DBC dlgCfg = new DBC();

            if (dlgCfg.Load(HomePath.GetAbsolutePath(FilePathDefine_Client.C_ClickNpc)))
            {
                for (int index = 0; index < dlgCfg.RowNum; index++)
                {
                    DBC_Row node = dlgCfg.GetRowByIndex(index);
                    if (null != node)
                    {
                        ClickNpcInfo info = new ClickNpcInfo();
                        info.LinkId         = DBCUtil.ExtractNumeric <int>(node, "LinkId", 0, true);
                        info.StoryId        = DBCUtil.ExtractNumeric <int>(node, "StoryId", 0, false);
                        info.UIName         = DBCUtil.ExtractString(node, "UIName", "", false);
                        info.Currency       = DBCUtil.ExtractNumeric <int>(node, "Currency", 0, true);
                        info.CurrencySprite = DBCUtil.ExtractString(node, "CurrencySprite", "", false);
                        if (!m_NpcInfos.ContainsKey(info.LinkId))
                        {
                            m_NpcInfos.Add(info.LinkId, info);
                        }
                    }
                }
            }
        }
Ejemplo n.º 10
0
        /**
         * @brief 私有提取函数
         *
         * @return
         */
        private List <Data_ActionInfo> ExtractAction(DBC_Row node, string prefix)
        {
            List <Data_ActionInfo> data = new List <Data_ActionInfo>();

            List <string> childList = DBCUtil.ExtractNodeByPrefix(node, prefix);

            if (childList.Count == 0)
            {
                return(data);
            }

            foreach (string child in childList)
            {
                if (string.IsNullOrEmpty(child))
                {
                    continue;
                }

                string outModelPath;
                string outSoundId;
                if (!_ParseModelPath(child, out outModelPath, out outSoundId))
                {
                    string info = "[Err]:ActionConfigProvider.ExtractAction anim name error:" + child;
                    throw new Exception(info);
                }

                Data_ActionInfo action = new Data_ActionInfo();
                action.m_AnimName = m_ActionPrefix + outModelPath;
                action.m_SoundId  = outSoundId;
                data.Add(action);
            }

            return(data);
        }
Ejemplo n.º 11
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_Level      = DBCUtil.ExtractNumeric <int>(node, "Level", 0, true);
     m_ConsumeExp = DBCUtil.ExtractNumeric <int>(node, "ConsumeExp", 0, true);
     m_RebornTime = DBCUtil.ExtractNumeric <int>(node, "RebornTime", 0, true);
     return(true);
 }
Ejemplo n.º 12
0
        public bool CollectDataFromDBC(DBC_Row node)
        {
            Id      = DBCUtil.ExtractNumeric(node, "Id", 0, true);
            MaxRank = DBCUtil.ExtractNumeric(node, "MaxRank", 0, true);
            List <int> num_list = new List <int>();

            num_list = DBCUtil.ExtractNumericList(node, "MaxParterLimit", 0, true);
            if (num_list != null)
            {
                MaxParterLimit = num_list.ToArray();
            }
            MaxBattleCount        = DBCUtil.ExtractNumeric(node, "MaxBattleCount", 0, true);
            BattleCd              = DBCUtil.ExtractNumeric(node, "BattleCd", 0, true);
            MaxFightTime          = DBCUtil.ExtractNumeric(node, "MaxFightTime", 30000, true);
            MaxHistoryCount       = DBCUtil.ExtractNumeric(node, "MaxHistoryCount", 10, true);
            AIId                  = DBCUtil.ExtractNumeric(node, "AIId", 0, true);
            BattleCountResetTime  = ConvertToSimpleTime(DBCUtil.ExtractString(node, "BattleCountResetTime", "00:00", true));
            PrizeSettlementTime   = ConvertToSimpleTime(DBCUtil.ExtractString(node, "PrizeSettlementTime", "00:00", true));
            PrizePresentTime      = ConvertToSimpleTime(DBCUtil.ExtractString(node, "PrizePresentTime", "00:00", true));
            QueryTopRankCount     = DBCUtil.ExtractNumeric(node, "QueryTopRank", 10, true);
            QueryFrontRankCount   = DBCUtil.ExtractNumeric(node, "QueryFrontRank", 5, true);
            QueryBehindRankCount  = DBCUtil.ExtractNumeric(node, "QueryFehindRank", 5, true);
            InfoRefreshTime       = DBCUtil.ExtractNumeric <long>(node, "InfoRefreshTime", 600000, true);
            TopRankRefreshTime    = DBCUtil.ExtractNumeric <long>(node, "RankRefreshTime", 600000, true);
            MatchGroupRefreshTime = DBCUtil.ExtractNumeric <long>(node, "MatchGroupRefreshTime", 600000, true);
            PrizeRetainDays       = DBCUtil.ExtractNumeric(node, "PrizeRetainDays", 7, true);
            return(true);
        }
Ejemplo n.º 13
0
        public bool CollectDataFromDBC(DBC_Row node)
        {
            int fitBegin = DBCUtil.ExtractNumeric(node, "FitBegin", 0, true);
            int fitEnd   = DBCUtil.ExtractNumeric(node, "FitEnd", 0, true);

            FitBegin = Math.Min(fitBegin, fitEnd);
            FitEnd   = Math.Max(fitBegin, fitEnd);
            List <int> phases = new List <int>();
            int        point  = DBCUtil.ExtractNumeric(node, "OneBegin", 0, true);

            phases.Add(point);
            point = DBCUtil.ExtractNumeric(node, "TwoBegin", 0, true);
            phases.Add(point);
            point = DBCUtil.ExtractNumeric(node, "ThreeBegin", 0, true);
            phases.Add(point);
            point = DBCUtil.ExtractNumeric(node, "ThreeEnd", 0, true);
            phases.Add(point);
            phases.Sort();
            if (phases.Count >= 4)
            {
                OneBegin   = phases[3];
                TwoBegin   = phases[2];
                ThreeBegin = phases[1];
                ThreeEnd   = phases[0];
            }
            return(true);
        }
Ejemplo n.º 14
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     BuyTime         = DBCUtil.ExtractNumeric <int>(node, "BuyTime", 0, true);
     RequireVipLevel = DBCUtil.ExtractNumeric <int>(node, "RequireVipLevel", 0, true);
     Cost            = DBCUtil.ExtractNumeric <int>(node, "Cost", 50, true);
     return(true);
 }
Ejemplo n.º 15
0
        public bool CollectDataFromDBC(DBC_Row node)
        {
            m_VipLevel         = DBCUtil.ExtractNumeric <int>(node, "VipLevel", 0, true);
            m_DiamondsRequired = DBCUtil.ExtractNumeric <int>(node, "DiamondsRequired", 0, true);
            m_Diamond          = DBCUtil.ExtractNumeric <int>(node, "Diamond", 0, false);
            m_Gold             = DBCUtil.ExtractNumeric <int>(node, "Gold", 0, false);
            m_Exp         = DBCUtil.ExtractNumeric <int>(node, "Exp", 0, false);
            m_Shell       = DBCUtil.ExtractNumeric <int>(node, "Shell", 0, false);
            m_Honor       = DBCUtil.ExtractNumeric <int>(node, "Honor", 0, false);
            m_ItemCount   = DBCUtil.ExtractNumeric <int>(node, "ItemCount", 0, false);
            m_ItemIdList  = new List <int>();
            m_ItemNumList = new List <int>();
            for (int i = 0; i < m_ItemCount; ++i)
            {
                m_ItemIdList.Add(DBCUtil.ExtractNumeric <int>(node, "ItemId_" + i, 0, false));
                m_ItemNumList.Add(DBCUtil.ExtractNumeric <int>(node, "ItemNum_" + i, 0, false));
            }
            m_Stamina        = DBCUtil.ExtractNumeric <int>(node, "BuyStaminaTime", 0, true);
            m_BuyGold        = DBCUtil.ExtractNumeric <int>(node, "BuyGoldTime", 0, true);
            m_TreasureTime   = DBCUtil.ExtractNumeric <int>(node, "TreasureTime", 0, true);
            m_GoldCombatTime = DBCUtil.ExtractNumeric <int>(node, "GoldCombatTime", 0, true);
            m_BossCombatTime = DBCUtil.ExtractNumeric <int>(node, "BossCombatTime", 0, true);
            m_PvpTime        = DBCUtil.ExtractNumeric <int>(node, "PvPTime", 0, true);
            m_EliteTime      = DBCUtil.ExtractNumeric <int>(node, "EliteTime", 0, true);

            return(true);
        }
Ejemplo n.º 16
0
        /**
         * @brief 从Xml节点中读取布尔值
         *
         * @param node xml节点
         * @param nodeName 节点名字
         * @param defualtVal 默认值
         * @param isMust 是否强制不能为空
         *
         * @return
         */
        public static bool ExtractBool(DBC_Row node, string nodeName, bool defualtVal, bool isMust)
        {
            bool result = defualtVal;

            if (node == null || !node.HasFields || node.SelectFieldByName(nodeName) == null)
            {
                return(result);
            }

            string nodeText = node.SelectFieldByName(nodeName);

            if (!CrossEngineHelper.StringIsNullOrEmpty(nodeText))
            {
                if (nodeText.Trim().ToLower() == "true" || nodeText.Trim().ToLower() == "1")
                {
                    result = true;
                }

                if (nodeText.Trim().ToLower() == "false" || nodeText.Trim().ToLower() == "0")
                {
                    result = false;
                }
            }

            return(result);
        }
Ejemplo n.º 17
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_Id                = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
     m_GoldSum           = DBCUtil.ExtractNumeric <int>(node, "GoldSum", 0, false);
     m_GoldMin           = DBCUtil.ExtractNumeric <int>(node, "GoldMin", 0, false);
     m_GoldMax           = DBCUtil.ExtractNumeric <int>(node, "GoldMax", 0, false);
     m_Exp               = DBCUtil.ExtractNumeric <int>(node, "Exp", 0, false);
     m_Diamond           = DBCUtil.ExtractNumeric <int>(node, "Diamond", 0, false);
     m_PartnerId         = DBCUtil.ExtractNumeric <int>(node, "PartnerId", 0, false);
     m_ItemCount         = DBCUtil.ExtractNumeric <int>(node, "ItemCount", 0, false);
     m_HpCount           = DBCUtil.ExtractNumeric <int>(node, "HpCount", 0, false);
     m_HpPercent         = DBCUtil.ExtractNumeric <int>(node, "HpPercent", 0, false);
     m_MpCount           = DBCUtil.ExtractNumeric <int>(node, "MpCount", 0, false);
     m_MpPercent         = DBCUtil.ExtractNumeric <int>(node, "MpPercent", 0, false);
     m_GoldModel         = DBCUtil.ExtractString(node, "GoldModel", "", false);
     m_GoldParticle      = DBCUtil.ExtractString(node, "GoldParticle", "", false);
     m_HpModel           = DBCUtil.ExtractString(node, "HpModel", "", false);
     m_HpParticle        = DBCUtil.ExtractString(node, "HpParticle", "", false);
     m_MpModel           = DBCUtil.ExtractString(node, "MpModel", "", false);
     m_MpParticle        = DBCUtil.ExtractString(node, "MpParticle", "", false);
     m_WarriorItemIdList = new List <int>();
     m_RogueItemIdList   = new List <int>();
     m_MageItemIdList    = new List <int>();
     m_ItemWeightList    = new List <int>();
     m_ItemCountList     = new List <int>();
     for (int i = 0; i < m_ItemCount; i++)
     {
         m_WarriorItemIdList.Add(DBCUtil.ExtractNumeric <int>(node, "WarriorItem" + i, 0, false));
         m_RogueItemIdList.Add(DBCUtil.ExtractNumeric <int>(node, "RogueItem" + i, 0, false));
         m_MageItemIdList.Add(DBCUtil.ExtractNumeric <int>(node, "MageItem" + i, 0, false));
         m_ItemWeightList.Add(DBCUtil.ExtractNumeric <int>(node, "Weight" + i, 0, false));
         m_ItemCountList.Add(DBCUtil.ExtractNumeric <int>(node, "Count" + i, 0, false));
     }
     return(true);
 }
Ejemplo n.º 18
0
        /**
         * @brief 从Xml节点中读取数值类型,使用时,必须在函数中指明数值类型
         *          如: int id = ExtractNumeric<int>(xmlNode, "Id", -1, true);
         *
         * @param node xml节点
         * @param nodeName 节点名字
         * @param defualtVal 默认值
         * @param isMust 是否强制不能为空
         *
         * @return
         */
        public static T ExtractNumeric <T>(DBC_Row node, string nodeName, T defualtVal, bool isMust)
        {
            T result = defualtVal;

            if (node == null || !node.HasFields || node.SelectFieldByName(nodeName) == null)
            {
                return(result);
            }

            string nodeText = node.SelectFieldByName(nodeName);

            if (!CrossEngineHelper.StringIsNullOrEmpty(nodeText))
            {
                try
                {
                    result = (T)Convert.ChangeType(nodeText, typeof(T));
                }
                catch (System.Exception ex)
                {
                    string info = string.Format("ExtractNumeric Error node:{0} nodeName:{1} ex:{2} stacktrace:{3}",
                                                node.RowIndex, nodeName, ex.Message, ex.StackTrace);
                    LogSystem.Debug(info);
                    CrossEngineHelper.LogCallStack();
                }
            }

            return(result);
        }
Ejemplo n.º 19
0
        public bool CollectDataFromDBC(string file, string rootLabel)
        {
            bool result = true;

            DBC document = new DBC();

            document.Load(HomePath.GetAbsolutePath(file));

            for (int index = 0; index < document.RowNum; index++)
            {
                DBC_Row node = document.GetRowByIndex(index);
                if (node != null)
                {
                    TData  data = new TData();
                    bool   ret  = data.CollectDataFromDBC(node);
                    string info = string.Format("DataTableMgr.CollectDataFromDBC collectData Row:{0} failed!", index);
                    LogSystem.Assert(ret, info);
                    if (ret)
                    {
                        m_DataContainer.Add(data);
                    }
                    else
                    {
                        result = false;
                    }
                }
            }

            return(result);
        }
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_Id       = DBCUtil.ExtractNumeric <int>(node, "ID", 0, true);
     m_Critical = (int)(DBCUtil.ExtractNumeric <float>(node, "Critical", 0, true) * c_IntRate);
     m_C        = (int)(DBCUtil.ExtractNumeric <float>(node, "C", 0, true) * c_IntRate * 10);
     return(true);
 }
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_Id            = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
     m_FightingScore = DBCUtil.ExtractNumeric <int>(node, "FightingScore", 0, true);
     m_SceneType     = (MpveSceneType)DBCUtil.ExtractNumeric <int>(node, "SceneType", 0, true);
     m_AttributeId   = DBCUtil.ExtractNumeric <int>(node, "AttributeId", 0, true);
     return(true);
 }
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_Id = DBCUtil.ExtractNumeric<int>(node, "Id", 0, true);
     m_Name = DBCUtil.ExtractString(node, "Name", "", true);
     m_Score = DBCUtil.ExtractNumeric<float>(node, "Score", 0, false);
     m_BaseValue = DBCUtil.ExtractNumeric<float>(node, "BaseValue", 0, false);
     return true;
 }
Ejemplo n.º 23
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     Id       = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
     Level    = DBCUtil.ExtractNumeric <int>(node, "Level", 0, true);
     ItemCost = DBCUtil.ExtractNumeric <int>(node, "ItemCost", 0, false);
     GoldCost = DBCUtil.ExtractNumeric <int>(node, "GoldCost", 0, false);
     return(true);
 }
Ejemplo n.º 24
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_Id     = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
     m_PeerA  = DBCUtil.ExtractNumeric <int>(node, "PeerA", 0, true);
     m_PeerB  = DBCUtil.ExtractNumeric <int>(node, "PeerB", 0, true);
     Property = DBCUtil.ExtractNumeric <int>(node, "Property", 0, false);
     return(true);
 }
Ejemplo n.º 25
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_Id    = DBCUtil.ExtractNumeric <int>(node, "ID", 0, true);
     m_Name  = DBCUtil.ExtractString(node, "Name", "", true);
     m_Path  = DBCUtil.ExtractString(node, "Path", "", true);
     m_Note  = DBCUtil.ExtractString(node, "Note", "", true);
     m_strId = DBCUtil.ExtractNumeric <int>(node, "StrID", 0, true);
     return(true);
 }
Ejemplo n.º 26
0
        /**
         * @brief 从Xml节点中抽取所有以prefix为前缀的节点
         *
         * @param node xml节点
         * @param prefix 前缀字符串
         *
         * @return
         */
        public static List <string> ExtractNodeByPrefix(DBC_Row node, string prefix)
        {
            if (node == null || !node.HasFields)
            {
                return(null);
            }

            return(node.SelectFieldsByPrefix(prefix));
        }
Ejemplo n.º 27
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     AttributeId    = DBCUtil.ExtractNumeric <int>(node, "AttributeId", 0, true);
     Describe       = DBCUtil.ExtractString(node, "Describe", "", false);
     AttributeType  = DBCUtil.ExtractNumeric <int>(node, "AttributeType", 0, true);
     ParamValues    = DBCUtil.ExtractNodeByPrefix(node, "ParamValue_");
     LevelAddValues = DBCUtil.ExtractNodeByPrefix(node, "LevelAdd_");
     return(true);
 }
Ejemplo n.º 28
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_MainNum      = DBCUtil.ExtractString(node, "MainNum", "1", true);
     m_SubNum       = DBCUtil.ExtractString(node, "SubNum", "0", true);
     m_StepNum      = DBCUtil.ExtractString(node, "StepNum", "0", true);
     m_DateNum      = DBCUtil.ExtractString(node, "DateNum", "0", true);
     m_GreekSymbols = DBCUtil.ExtractString(node, "GreekSymbols", "base", true);
     return(true);
 }
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_Id            = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
     m_LinkId        = DBCUtil.ExtractNumericList <int>(node, "LinkId", 0, true);
     m_FightingScore = DBCUtil.ExtractNumeric <int>(node, "FightingScore", 0, true);
     m_Type          = (MonsterType)DBCUtil.ExtractNumeric <int>(node, "MonsterType", 0, true);
     m_AttributeId   = DBCUtil.ExtractNumericList <int>(node, "AttributeId", 0, true);
     return(true);
 }
Ejemplo n.º 30
0
 public bool CollectDataFromDBC(DBC_Row node)
 {
     m_SceneId      = DBCUtil.ExtractNumeric <int>(node, "SceneId", 0, true);
     m_Name         = DBCUtil.ExtractString(node, "Name", "", true);
     m_Discribe     = DBCUtil.ExtractString(node, "Dis", "", true);
     m_ChapterName1 = DBCUtil.ExtractString(node, "ChapterName_1", "", false);
     m_ChapterName2 = DBCUtil.ExtractString(node, "ChapterName_2", "", false);
     m_Level        = DBCUtil.ExtractNumeric <int>(node, "Level", -1, true);
     return(true);
 }