private static void XmlGetTalentEffect(TalentInfo talentInfo, int level, string strEffect) { if (!string.IsNullOrEmpty(strEffect)) { string[] arrEffect = strEffect.Split(new char[] { '|' }); List <TalentEffectInfo> list = new List <TalentEffectInfo>(); foreach (string effect in arrEffect) { string[] arr = effect.Split(new char[] { ',' }); TalentEffectInfo info = new TalentEffectInfo(); info.EffectType = talentInfo.EffectType; switch (info.EffectType) { case 1: info.EffectID = (int)Enum.Parse(typeof(UnitPropIndexes), arr[0]); info.EffectValue = double.Parse(arr[1]); break; case 2: info.EffectID = (int)Enum.Parse(typeof(ExtPropIndexes), arr[0]); info.EffectValue = double.Parse(arr[1]); break; case 3: case 4: info.EffectID = int.Parse(arr[1]); info.EffectValue = double.Parse(arr[2]); break; } list.Add(info); } talentInfo.EffectList.Add(level, list); } }
/// <summary> /// 解析效果数据 /// </summary> private static void XmlGetTalentEffect(TalentInfo talentInfo, int level, string strEffect) { if (string.IsNullOrEmpty(strEffect)) { return; } string[] arrEffect = strEffect.Split('|'); List <TalentEffectInfo> list = new List <TalentEffectInfo>(); foreach (string effect in arrEffect) { string[] arr = effect.Split(','); TalentEffectInfo info = new TalentEffectInfo(); info.EffectType = talentInfo.EffectType; switch (info.EffectType) { case (int)TalentEffectType.PropBasic: info.EffectID = (int)Enum.Parse(typeof(UnitPropIndexes), arr[0]); info.EffectValue = double.Parse(arr[1]); break; case (int)TalentEffectType.PropExt: info.EffectID = (int)Enum.Parse(typeof(ExtPropIndexes), arr[0]); info.EffectValue = double.Parse(arr[1]); break; case (int)TalentEffectType.SkillOne: case (int)TalentEffectType.SkillAll: info.EffectID = int.Parse(arr[1]); //技能id,职业类型 info.EffectValue = double.Parse(arr[2]); break; } list.Add(info); } talentInfo.EffectList.Add(level, list); }