/// <summary> /// Load the Enhancement from the XmlNode. /// </summary> /// <param name="objNode">XmlNode to load.</param> public void Load(XmlNode objNode) { Improvement objImprovement = new Improvement(); _guiID = Guid.Parse(objNode["guid"].InnerText); _strName = objNode["name"].InnerText; _strSource = objNode["source"].InnerText; _strPage = objNode["page"].InnerText; _nodBonus = objNode["bonus"]; _objImprovementSource = objImprovement.ConvertToImprovementSource(objNode["improvementsource"].InnerText); try { _intGrade = Convert.ToInt32(objNode["grade"].InnerText); } catch { } try { _strNotes = objNode["notes"].InnerText; } catch { } }
/// <summary> /// Load the Metamagic from the XmlNode. /// </summary> /// <param name="objNode">XmlNode to load.</param> public void Load(XmlNode objNode) { Improvement objImprovement = new Improvement(); _guiID = Guid.Parse(objNode["guid"].InnerText); _strName = objNode["name"].InnerText; _strSource = objNode["source"].InnerText; _strPage = objNode["page"].InnerText; try { _blnPaidWithKarma = Convert.ToBoolean(objNode["paidwithkarma"].InnerText); } catch { } _nodBonus = objNode["bonus"]; _objImprovementSource = objImprovement.ConvertToImprovementSource(objNode["improvementsource"].InnerText); try { _strNotes = objNode["notes"].InnerText; } catch { } }
/// <summary> /// Load the Spell from the XmlNode. /// </summary> /// <param name="objNode">XmlNode to load.</param> public void Load(XmlNode objNode) { Improvement objImprovement = new Improvement(); _guiID = Guid.Parse(objNode["guid"].InnerText); _strName = objNode["name"].InnerText; _strDescriptors = objNode["descriptors"].InnerText; _strCategory = objNode["category"].InnerText; _strType = objNode["type"].InnerText; _strRange = objNode["range"].InnerText; _strDamage = objNode["damage"].InnerText; _strDuration = objNode["duration"].InnerText; try { _objImprovementSource = objImprovement.ConvertToImprovementSource(objNode["improvementsource"].InnerText); } catch { } try { _intGrade = Convert.ToInt32(objNode["grade"].InnerText); } catch { } _strDV = objNode["dv"].InnerText; try { _blnLimited = Convert.ToBoolean(objNode["limited"].InnerText); } catch { } try { _blnExtended = Convert.ToBoolean(objNode["extended"].InnerText); } catch { } try { _blnAlchemical = Convert.ToBoolean(objNode["alchemical"].InnerText); } catch { } _strSource = objNode["source"].InnerText; try { _strPage = objNode["page"].InnerText; } catch { } try { _strExtra = objNode["extra"].InnerText; } catch { } try { _strNotes = objNode["notes"].InnerText; } catch { } if (GlobalOptions.Instance.Language != "en-us") { XmlDocument objXmlDocument = XmlManager.Instance.Load("spells.xml"); XmlNode objSpellNode = objXmlDocument.SelectSingleNode("/chummer/spells/spell[name = \"" + _strName + "\"]"); if (objSpellNode != null) { if (objSpellNode["translate"] != null) _strAltName = objSpellNode["translate"].InnerText; if (objSpellNode["altpage"] != null) _strAltPage = objSpellNode["altpage"].InnerText; } objSpellNode = objXmlDocument.SelectSingleNode("/chummer/categories/category[. = \"" + _strCategory + "\"]"); if (objSpellNode != null) { if (objSpellNode.Attributes["translate"] != null) _strAltCategory = objSpellNode.Attributes["translate"].InnerText; } } }
/// <summary> /// Load the Metamagic from the XmlNode. /// </summary> /// <param name="objNode">XmlNode to load.</param> public void Load(XmlNode objNode) { Improvement objImprovement = new Improvement(); _guidExternalID = Guid.Parse(objNode["eguid"].InnerText); _guiID = Guid.Parse(objNode["guid"].InnerText); _strName = objNode["name"].InnerText; _strSource = objNode["source"].InnerText; _strPage = objNode["page"].InnerText; _blnPaidWithKarma = Convert.ToBoolean(objNode["paidwithkarma"].InnerText); _nodBonus = objNode["bonus"]; _nodConditional = objNode["conditional"]; _objImprovementSource = objImprovement.ConvertToImprovementSource(objNode["improvementsource"].InnerText); _strNotes = objNode["notes"].InnerText; if (GlobalOptions.Instance.Language != "en-us") { string strXmlFile = ""; string strXPath = ""; if (_objImprovementSource == Improvement.ImprovementSource.Metamagic) { strXmlFile = "metamagic.xml"; strXPath = "/chummer/metamagics/metamagic"; } else { strXmlFile = "echoes.xml"; strXPath = "/chummer/echoes/echo"; } XmlDocument objXmlDocument = XmlManager.Instance.Load(strXmlFile); XmlNode objMetamagicNode = objXmlDocument.SelectSingleNode(strXPath + "[id = \"" + ExternalId + "\"]"); if (objMetamagicNode != null) { if (objMetamagicNode["translate"] != null) _strAltName = objMetamagicNode["translate"].InnerText; if (objMetamagicNode["altpage"] != null) _strAltPage = objMetamagicNode["altpage"].InnerText; } } }