/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("accessory"); objWriter.WriteElementString("name", DisplayName); objWriter.WriteElementString("mount", _strMount); objWriter.WriteElementString("extramount", _strExtraMount); objWriter.WriteElementString("rc", _strRC); objWriter.WriteElementString("conceal", _strConceal); objWriter.WriteElementString("avail", TotalAvail); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("included", _blnIncludedInWeapon.ToString()); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("accuracy", _intAccuracy.ToString()); if (_lstGear.Count > 0) { objWriter.WriteStartElement("gears"); foreach (Gear objGear in _lstGear) { // Use the Gear's SubClass if applicable. if (objGear.GetType() == typeof(Commlink)) { Commlink objCommlink = new Commlink(_objCharacter); objCommlink = (Commlink)objGear; objCommlink.Print(objWriter); } else { objGear.Print(objWriter); } } objWriter.WriteEndElement(); } if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter, CultureInfo objCulture) { objWriter.WriteStartElement("armormod"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("name_english", _strName); objWriter.WriteElementString("category", DisplayCategory); objWriter.WriteElementString("category_english", _strCategory); objWriter.WriteElementString("armor", _intA.ToString(objCulture)); objWriter.WriteElementString("maxrating", _intMaxRating.ToString(objCulture)); objWriter.WriteElementString("rating", _intRating.ToString(objCulture)); objWriter.WriteElementString("avail", TotalAvail); objWriter.WriteElementString("cost", TotalCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("owncost", OwnCost.ToString(_objCharacter.Options.NuyenFormat, objCulture)); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("included", _blnIncludedInArmor.ToString()); objWriter.WriteElementString("equipped", _blnEquipped.ToString()); objWriter.WriteElementString("wirelesson", _blnWirelessOn.ToString()); objWriter.WriteStartElement("gears"); foreach (Gear objGear in _lstGear) { // Use the Gear's SubClass if applicable. Commlink objCommlink = objGear as Commlink; if (objCommlink != null) { objCommlink.Print(objWriter, objCulture); } else { objGear.Print(objWriter, objCulture); } } objWriter.WriteEndElement(); objWriter.WriteElementString("extra", LanguageManager.TranslateExtra(_strExtra)); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
/// <summary> /// Save the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public new void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("gear"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("name_english", _strName); if (DisplayCategory.EndsWith("s")) objWriter.WriteElementString("category", DisplayCategory.Substring(0,DisplayCategory.Length -1)); else objWriter.WriteElementString("category", DisplayCategory); objWriter.WriteElementString("category_english", _strCategory); objWriter.WriteElementString("iscommlink", true.ToString()); objWriter.WriteElementString("ispersona", IsLivingPersona.ToString()); objWriter.WriteElementString("isnexus", (_strCategory == "Nexus").ToString()); objWriter.WriteElementString("isammo", (_strCategory == "Ammunition").ToString()); objWriter.WriteElementString("isprogram", IsProgram.ToString()); objWriter.WriteElementString("isos", false.ToString()); objWriter.WriteElementString("issin", false.ToString()); objWriter.WriteElementString("maxrating", _intMaxRating.ToString()); objWriter.WriteElementString("rating", _intRating.ToString()); objWriter.WriteElementString("attack", _intAttack.ToString()); objWriter.WriteElementString("sleaze", _intSleaze.ToString()); objWriter.WriteElementString("dataprocessing", _intDataProcessing.ToString()); objWriter.WriteElementString("firewall", _intFirewall.ToString()); objWriter.WriteElementString("qty", _intQty.ToString()); objWriter.WriteElementString("avail", TotalAvail(true)); objWriter.WriteElementString("avail_english", TotalAvail(true, true)); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("extra", LanguageManager.Instance.TranslateExtra(_strExtra)); objWriter.WriteElementString("bonded", _blnBonded.ToString()); objWriter.WriteElementString("equipped", _blnEquipped.ToString()); objWriter.WriteElementString("homenode", _blnHomeNode.ToString()); objWriter.WriteElementString("gearname", _strGearName); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("devicerating", TotalDeviceRating.ToString()); objWriter.WriteElementString("processorlimit", ProcessorLimit.ToString()); objWriter.WriteElementString("conditionmonitor", ConditionMonitor.ToString()); objWriter.WriteElementString("active", _blnActiveCommlink.ToString()); objWriter.WriteStartElement("children"); foreach (Gear objGear in _objChildren) { if (objGear.Category != "Commlink Upgrade" && objGear.Category != "Commlink Operating System Upgrade") { // Use the Gear's SubClass if applicable. if (objGear.GetType() == typeof(Commlink)) { Commlink objCommlink = new Commlink(_objCharacter); objCommlink = (Commlink)objGear; objCommlink.Print(objWriter); } else { objGear.Print(objWriter); } } } objWriter.WriteEndElement(); if (_objCharacter.Options.PrintNotes) objWriter.WriteElementString("notes", _strNotes); objWriter.WriteEndElement(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("vehicle"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("category", DisplayCategory); objWriter.WriteElementString("handling", TotalHandling.ToString()); objWriter.WriteElementString("accel", TotalAccel.ToString()); objWriter.WriteElementString("speed", TotalSpeed.ToString()); objWriter.WriteElementString("pilot", Pilot.ToString()); objWriter.WriteElementString("body", TotalBody.ToString()); objWriter.WriteElementString("armor", TotalArmor.ToString()); objWriter.WriteElementString("seats", _intSeats.ToString()); objWriter.WriteElementString("sensor", _intSensor.ToString()); objWriter.WriteElementString("avail", CalculatedAvail); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("physicalcm", PhysicalCM.ToString()); objWriter.WriteElementString("matrixcm", ConditionMonitor.ToString()); objWriter.WriteElementString("physicalcmfilled", _intPhysicalCMFilled.ToString()); objWriter.WriteElementString("vehiclename", _strVehicleName); objWriter.WriteElementString("devicerating", TotalDeviceRating.ToString()); objWriter.WriteElementString("maneuver", Maneuver.ToString()); objWriter.WriteElementString("homenode", _blnHomeNode.ToString()); objWriter.WriteStartElement("mods"); foreach (VehicleMod objMod in _lstVehicleMods) objMod.Print(objWriter); objWriter.WriteEndElement(); objWriter.WriteStartElement("gears"); foreach (Gear objGear in _lstGear) { // Use the Gear's SubClass if applicable. if (objGear.GetType() == typeof(Commlink)) { Commlink objCommlink = new Commlink(_objCharacter); objCommlink = (Commlink)objGear; objCommlink.Print(objWriter); } else { objGear.Print(objWriter); } } objWriter.WriteEndElement(); objWriter.WriteStartElement("weapons"); foreach (Weapon objWeapon in _lstWeapons) objWeapon.Print(objWriter); objWriter.WriteEndElement(); if (_objCharacter.Options.PrintNotes) objWriter.WriteElementString("notes", _strNotes); objWriter.WriteEndElement(); }
/// <summary> /// Save the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public new void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("gear"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("name_english", _strName); if (DisplayCategory.EndsWith("s")) { objWriter.WriteElementString("category", DisplayCategory.Substring(0, DisplayCategory.Length - 1)); } else { objWriter.WriteElementString("category", DisplayCategory); } objWriter.WriteElementString("category_english", _strCategory); objWriter.WriteElementString("iscommlink", true.ToString()); objWriter.WriteElementString("ispersona", IsLivingPersona.ToString()); //objWriter.WriteElementString("isnexus", (_strCategory == "Nexus").ToString()); objWriter.WriteElementString("isammo", (_strCategory == "Ammunition").ToString()); objWriter.WriteElementString("isprogram", IsProgram.ToString()); objWriter.WriteElementString("isos", false.ToString()); objWriter.WriteElementString("issin", false.ToString()); objWriter.WriteElementString("maxrating", _intMaxRating.ToString()); objWriter.WriteElementString("rating", _intRating.ToString()); objWriter.WriteElementString("attack", _intAttack.ToString()); objWriter.WriteElementString("sleaze", _intSleaze.ToString()); objWriter.WriteElementString("dataprocessing", _intDataProcessing.ToString()); objWriter.WriteElementString("firewall", _intFirewall.ToString()); objWriter.WriteElementString("qty", _intQty.ToString()); objWriter.WriteElementString("avail", TotalAvail(true)); objWriter.WriteElementString("avail_english", TotalAvail(true, true)); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("extra", LanguageManager.Instance.TranslateExtra(_strExtra)); objWriter.WriteElementString("bonded", _blnBonded.ToString()); objWriter.WriteElementString("equipped", _blnEquipped.ToString()); objWriter.WriteElementString("homenode", _blnHomeNode.ToString()); objWriter.WriteElementString("gearname", _strGearName); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("devicerating", TotalDeviceRating.ToString()); objWriter.WriteElementString("processorlimit", ProcessorLimit.ToString()); objWriter.WriteElementString("conditionmonitor", ConditionMonitor.ToString()); objWriter.WriteElementString("active", _blnActiveCommlink.ToString()); objWriter.WriteStartElement("children"); foreach (Gear objGear in _objChildren) { if (objGear.Category != "Commlink Upgrade" && objGear.Category != "Commlink Operating System Upgrade") { // Use the Gear's SubClass if applicable. if (objGear.GetType() == typeof(Commlink)) { Commlink objCommlink = new Commlink(_objCharacter); objCommlink = (Commlink)objGear; objCommlink.Print(objWriter); } else { objGear.Print(objWriter); } } } objWriter.WriteEndElement(); if (_objCharacter.Options.PrintNotes) { objWriter.WriteElementString("notes", _strNotes); } objWriter.WriteEndElement(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("accessory"); objWriter.WriteElementString("name", DisplayName); objWriter.WriteElementString("mount", _strMount); objWriter.WriteElementString("rc", _strRC); objWriter.WriteElementString("conceal", _strConceal); objWriter.WriteElementString("avail", TotalAvail); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("included", _blnIncludedInWeapon.ToString()); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("accuracy", _intAccuracy.ToString()); if (_lstGear.Count > 0) { objWriter.WriteStartElement("gears"); foreach (Gear objGear in _lstGear) { // Use the Gear's SubClass if applicable. if (objGear.GetType() == typeof(Commlink)) { Commlink objCommlink = new Commlink(_objCharacter); objCommlink = (Commlink)objGear; objCommlink.Print(objWriter); } else { objGear.Print(objWriter); } } objWriter.WriteEndElement(); } if (_objCharacter.Options.PrintNotes) objWriter.WriteElementString("notes", _strNotes); objWriter.WriteEndElement(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("armor"); objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("name_english", _strName); objWriter.WriteElementString("category", DisplayCategory); objWriter.WriteElementString("category_english", _strCategory); objWriter.WriteElementString("armor", TotalArmor.ToString()); objWriter.WriteElementString("avail", TotalAvail); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteElementString("armorname", _strArmorName); objWriter.WriteElementString("equipped", _blnEquipped.ToString()); objWriter.WriteStartElement("armormods"); foreach (ArmorMod objMod in _lstArmorMods) { objMod.Print(objWriter); } objWriter.WriteEndElement(); objWriter.WriteStartElement("gears"); foreach (Gear objGear in _lstGear) { // Use the Gear's SubClass if applicable. if (objGear.GetType() == typeof(Commlink)) { Commlink objCommlink = new Commlink(_objCharacter); objCommlink = (Commlink)objGear; objCommlink.Print(objWriter); } else { objGear.Print(objWriter); } } objWriter.WriteEndElement(); objWriter.WriteElementString("extra", LanguageManager.Instance.TranslateExtra(_strExtra)); objWriter.WriteElementString("location", _strLocation); if (_objCharacter.Options.PrintNotes) objWriter.WriteElementString("notes", _strNotes); objWriter.WriteEndElement(); }
/// <summary> /// Print the object's XML to the XmlWriter. /// </summary> /// <param name="objWriter">XmlTextWriter to write with.</param> public void Print(XmlTextWriter objWriter) { objWriter.WriteStartElement("gear"); if ((_strCategory == "Foci" || _strCategory == "Metamagic Foci") && _blnBonded) { objWriter.WriteElementString("name", DisplayNameShort + " (" + LanguageManager.Instance.GetString("Label_BondedFoci") + ")"); } else objWriter.WriteElementString("name", DisplayNameShort); objWriter.WriteElementString("name_english", _strName); objWriter.WriteElementString("category", DisplayCategory); objWriter.WriteElementString("category_english", _strCategory); objWriter.WriteElementString("iscommlink", false.ToString()); objWriter.WriteElementString("ispersona", false.ToString()); objWriter.WriteElementString("isnexus", (_strCategory == "Nexus").ToString()); objWriter.WriteElementString("isammo", (_strCategory == "Ammunition").ToString()); objWriter.WriteElementString("isprogram", IsProgram.ToString()); objWriter.WriteElementString("isos", false.ToString()); if (_strName == "Fake SIN") objWriter.WriteElementString("issin", true.ToString()); else objWriter.WriteElementString("issin", false.ToString()); objWriter.WriteElementString("capacity", _strCapacity); objWriter.WriteElementString("maxrating", _intMaxRating.ToString()); objWriter.WriteElementString("rating", _intRating.ToString()); objWriter.WriteElementString("qty", _intQty.ToString()); objWriter.WriteElementString("avail", TotalAvail(true)); objWriter.WriteElementString("avail_english", TotalAvail(true, true)); objWriter.WriteElementString("cost", TotalCost.ToString()); objWriter.WriteElementString("owncost", OwnCost.ToString()); objWriter.WriteElementString("extra", LanguageManager.Instance.TranslateExtra(_strExtra)); objWriter.WriteElementString("bonded", _blnBonded.ToString()); objWriter.WriteElementString("equipped", _blnEquipped.ToString()); objWriter.WriteElementString("homenode", _blnHomeNode.ToString()); objWriter.WriteElementString("location", _strLocation); objWriter.WriteElementString("gearname", _strGearName); objWriter.WriteElementString("source", _objCharacter.Options.LanguageBookShort(_strSource)); objWriter.WriteElementString("page", Page); objWriter.WriteStartElement("children"); foreach (Gear objGear in _objChildren) { // Use the Gear's SubClass if applicable. if (objGear.GetType() == typeof(Commlink)) { Commlink objCommlink = new Commlink(_objCharacter); objCommlink = (Commlink)objGear; objCommlink.Print(objWriter); } else { objGear.Print(objWriter); } } objWriter.WriteEndElement(); if (_nodWeaponBonus != null) { objWriter.WriteElementString("weaponbonusdamage", WeaponBonusDamage()); objWriter.WriteElementString("weaponbonusdamage_english", WeaponBonusDamage(true)); objWriter.WriteElementString("weaponbonusap", WeaponBonusAP); } if (_objCharacter.Options.PrintNotes) objWriter.WriteElementString("notes", _strNotes); objWriter.WriteEndElement(); }