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 diff
     1.1 --- a/api/Factories/Xml/WarFoundryXmlSaver.cs	Tue Sep 08 19:27:51 2009 +0000
     1.2 +++ b/api/Factories/Xml/WarFoundryXmlSaver.cs	Sun Sep 13 17:18:41 2009 +0000
     1.3 @@ -97,7 +97,7 @@
     1.4  		{
     1.5  			XmlElement unitElem = doc.CreateElement("unit");
     1.6  			unitElem.SetAttribute("id", XmlTools.GetAsciiXmlIdForString(unit.ID));
     1.7 -			unitElem.SetAttribute("unitName", unit.Name);
     1.8 +			unitElem.SetAttribute("unitName", (unit.HasDefaultName() ? "" : unit.Name));
     1.9  			unitElem.SetAttribute("unitType", unit.UnitType.ID);
    1.10  			unitElem.SetAttribute("size", unit.Size.ToString());
    1.11  			
     2.1 --- a/api/Objects/WarFoundryObject.cs	Tue Sep 08 19:27:51 2009 +0000
     2.2 +++ b/api/Objects/WarFoundryObject.cs	Sun Sep 13 17:18:41 2009 +0000
     2.3 @@ -74,7 +74,7 @@
     2.4  			}
     2.5  		}
     2.6  
     2.7 -		protected bool HasDefaultName()
     2.8 +		public bool HasDefaultName()
     2.9  		{
    2.10  			return (name == null || name == "");
    2.11  		}