static ConfigParser() { for (ExtPropIndexes i = ExtPropIndexes.Strong; i < ExtPropIndexes.Max; i++) { ConfigParser.ExtPropName2ExtPropIndexDict[i.ToString()] = i; } }
/// <summary> /// 静态构造函数 /// </summary> static ConfigParser() { for (ExtPropIndexes i = (ExtPropIndexes)0; i < ExtPropIndexes.Max; i++) { ExtPropName2ExtPropIndexDict[i.ToString()] = i; } }
public static void ParseXiLianShuXing(XElement node) { XiLianShuXing xiLianShuXing = new XiLianShuXing(); xiLianShuXing.ID = (int)Global.GetSafeAttributeLong(node, "ID"); xiLianShuXing.Name = Global.GetSafeAttributeStr(node, "Name"); xiLianShuXing.NeedJinBi = (int)Global.GetSafeAttributeLong(node, "NeedJinBi"); xiLianShuXing.NeedZuanShi = (int)Global.GetSafeAttributeLong(node, "NeedZuanShi"); long[] args = Global.GetSafeAttributeLongArray(node, "NeedGoods", 2); if (null != args) { xiLianShuXing.NeedGoodsIDs.Add((int)args[0]); xiLianShuXing.NeedGoodsCounts.Add((int)args[1]); } foreach (var propsID in PropsIds) { string attributeName; ExtPropIndexes propIndex = (ExtPropIndexes)propsID; attributeName = string.Format("JinBi{0}", propIndex.ToString()); args = Global.GetSafeAttributeLongArray(node, attributeName); if (null != args && args.Length > 0) { xiLianShuXing.PromoteJinBiRange.Add(propsID, new List <long>(args)); } attributeName = string.Format("ZuanShi{0}", propIndex.ToString()); args = Global.GetSafeAttributeLongArray(node, attributeName); if (null != args && args.Length > 0) { xiLianShuXing.PromoteZuanShiRange.Add(propsID, new List <long>(args)); } xiLianShuXing.PromotePropLimit.Add((int)propIndex, (int)Global.GetSafeAttributeLong(node, propIndex.ToString())); } XiLianShuXingDict.Add(xiLianShuXing.ID, xiLianShuXing); }