Mercurial > repos > IBBoard.WarFoundry.API
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 wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlFactory.cs Sun Mar 22 17:05:01 2009 +0000 +++ b/api/Factories/Xml/WarFoundryXmlFactory.cs Sun Mar 22 17:10:49 2009 +0000 @@ -542,16 +542,10 @@ } catch(ArgumentException ex) { - //throw new InvalidFileException("Attribute 'armourType' of equipment "+id+" was not a valid value from the enumeration"); - LogNotifier.WarnFormat(GetType(), "Invalid 'armourType' for equipment {0} - {1}", id, ex.Message); - armourType = ArmourType.None; + throw new InvalidFileException("Attribute 'armourType' of equipment "+id+" was not a valid value from the enumeration"); } - if (elem.ChildNodes.Count>0) - { - //It has stats! - //TODO: Parse equipment stats - } + //TODO: Parse equipment stats if there are any return new EquipmentItem(id, name, cost, min, max, armourType, race); }
--- a/dtds/race.xsd Sun Mar 22 17:05:01 2009 +0000 +++ b/dtds/race.xsd Sun Mar 22 17:10:49 2009 +0000 @@ -127,7 +127,7 @@ <xs:attribute name="id" type="xs:ID" use="required"/> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="cost" type="core:nonNegativeNonInfiniteDouble" use="required"/> - <xs:attribute name="armoutType" type="armourtype" default="None"/> + <xs:attribute name="armourType" type="armourtype" default="None"/> </xs:complexType> <xs:simpleType name="armourtype"> <xs:restriction base="xs:string">