changeset 137:f58051572ec7

Fixes #128: Don't save out default names * Check if unit has default name before exporting * Make HasDefaultName() method public from protected
author IBBoard <dev@ibboard.co.uk>
date Sun, 13 Sep 2009 17:18:41 +0000
parents 413a7a049e41
children c11c0da01bbc
files api/Factories/Xml/WarFoundryXmlSaver.cs api/Objects/WarFoundryObject.cs
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlSaver.cs	Tue Sep 08 19:27:51 2009 +0000
+++ b/api/Factories/Xml/WarFoundryXmlSaver.cs	Sun Sep 13 17:18:41 2009 +0000
@@ -97,7 +97,7 @@
 		{
 			XmlElement unitElem = doc.CreateElement("unit");
 			unitElem.SetAttribute("id", XmlTools.GetAsciiXmlIdForString(unit.ID));
-			unitElem.SetAttribute("unitName", unit.Name);
+			unitElem.SetAttribute("unitName", (unit.HasDefaultName() ? "" : unit.Name));
 			unitElem.SetAttribute("unitType", unit.UnitType.ID);
 			unitElem.SetAttribute("size", unit.Size.ToString());
 			
--- a/api/Objects/WarFoundryObject.cs	Tue Sep 08 19:27:51 2009 +0000
+++ b/api/Objects/WarFoundryObject.cs	Sun Sep 13 17:18:41 2009 +0000
@@ -74,7 +74,7 @@
 			}
 		}
 
-		protected bool HasDefaultName()
+		public bool HasDefaultName()
 		{
 			return (name == null || name == "");
 		}