public void Save() { if (!Directory.Exists(Paths.DataPath + "Dex\\" + DexNum)) { Directory.CreateDirectory(Paths.DataPath + "Dex\\" + DexNum); } using (XmlWriter writer = XmlWriter.Create(Paths.DataPath + "Dex\\" + DexNum + ".xml", Logger.XmlWriterSettings)) { writer.WriteStartDocument(); writer.WriteStartElement("DexEntry"); #region Basic data writer.WriteStartElement("General"); writer.WriteElementString("Name", Name); writer.WriteElementString("SpeciesName", SpeciesName); writer.WriteElementString("GrowthGroup", Growth.ToString()); writer.WriteElementString("EggGroup1", EggGroup1.ToString()); writer.WriteElementString("EggGroup2", EggGroup2.ToString()); writer.WriteEndElement(); #endregion Basic data writer.WriteEndElement(); writer.WriteEndDocument(); } foreach (DexFormEntry form in Forms) { form.Save(DexNum); } }
public string GetRow() { var sb = new StringBuilder(); sb.Append(Name); sb.Append('\t'); sb.Append(Plural1); sb.Append('\t'); if (Creature.HasSecondPlural) { sb.Append(Plural2); sb.Append('\t'); } sb.Append(PriceLumber.ToString()); sb.Append('\t'); sb.Append(PriceMercury.ToString()); sb.Append('\t'); sb.Append(PriceOre.ToString()); sb.Append('\t'); sb.Append(PriceSulphur.ToString()); sb.Append('\t'); sb.Append(PriceCrystals.ToString()); sb.Append('\t'); sb.Append(PriceGems.ToString()); sb.Append('\t'); sb.Append(PriceGold.ToString()); sb.Append('\t'); sb.Append(FightValue.ToString()); sb.Append('\t'); sb.Append(AIValue.ToString()); sb.Append('\t'); sb.Append(Growth.ToString()); sb.Append('\t'); sb.Append(hordeGrowth.ToString()); sb.Append('\t'); sb.Append(HP.ToString()); sb.Append('\t'); sb.Append(Speed.ToString()); sb.Append('\t'); sb.Append(Attack.ToString()); sb.Append('\t'); sb.Append(Defense.ToString()); sb.Append('\t'); sb.Append(LoDamage.ToString()); sb.Append('\t'); sb.Append(HiDamage.ToString()); sb.Append('\t'); sb.Append(Arrows.ToString()); sb.Append('\t'); sb.Append(Spells.ToString()); sb.Append('\t'); sb.Append(low.ToString()); sb.Append('\t'); sb.Append(high.ToString()); sb.Append('\t'); sb.Append(Description.ToString()); sb.Append('\t'); sb.Append(attributes.ToString()); return(sb.ToString()); }