changeset 44:db951aad24b9

Re #50 - Complete loading of WarFoundry XML * Fix loading of armour type by fixing typo in Race schema * Revert to an exception if there is a parse error on the armour type (since the schema should validate it)
author IBBoard <dev@ibboard.co.uk>
date Sun, 22 Mar 2009 17:10:49 +0000
parents d0812d7de39d
children 75a44b7753d4
files api/Factories/Xml/WarFoundryXmlFactory.cs dtds/race.xsd
diffstat 2 files changed, 3 insertions(+), 9 deletions(-) [+]
line diff
     1.1 --- a/api/Factories/Xml/WarFoundryXmlFactory.cs	Sun Mar 22 17:05:01 2009 +0000
     1.2 +++ b/api/Factories/Xml/WarFoundryXmlFactory.cs	Sun Mar 22 17:10:49 2009 +0000
     1.3 @@ -542,16 +542,10 @@
     1.4  			}
     1.5  			catch(ArgumentException ex)
     1.6  			{
     1.7 -				//throw new InvalidFileException("Attribute 'armourType' of equipment "+id+" was not a valid value from the enumeration");
     1.8 -				LogNotifier.WarnFormat(GetType(), "Invalid 'armourType' for equipment {0} - {1}", id, ex.Message);
     1.9 -				armourType = ArmourType.None;
    1.10 +				throw new InvalidFileException("Attribute 'armourType' of equipment "+id+" was not a valid value from the enumeration");
    1.11  			}
    1.12  			
    1.13 -			if (elem.ChildNodes.Count>0)
    1.14 -			{
    1.15 -				//It has stats!
    1.16 -				//TODO: Parse equipment stats
    1.17 -			}
    1.18 +			//TODO: Parse equipment stats if there are any
    1.19  			
    1.20  			return new EquipmentItem(id, name, cost, min, max, armourType, race);
    1.21  		}
     2.1 --- a/dtds/race.xsd	Sun Mar 22 17:05:01 2009 +0000
     2.2 +++ b/dtds/race.xsd	Sun Mar 22 17:10:49 2009 +0000
     2.3 @@ -127,7 +127,7 @@
     2.4    <xs:attribute name="id" type="xs:ID" use="required"/>
     2.5    <xs:attribute name="name" type="xs:string" use="required"/>
     2.6    <xs:attribute name="cost" type="core:nonNegativeNonInfiniteDouble" use="required"/>
     2.7 -  <xs:attribute name="armoutType" type="armourtype" default="None"/>
     2.8 +  <xs:attribute name="armourType" type="armourtype" default="None"/>
     2.9  </xs:complexType>
    2.10  <xs:simpleType name="armourtype">
    2.11    <xs:restriction base="xs:string">