Mercurial > repos > IBBoard.WarFoundry.API
comparison api/Factories/Xml/WarFoundryXmlRaceFactory.cs @ 133:a6d1cc17ec33
* Fix XPath query so that units get the right stats instead of just the first stats
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 01 Sep 2009 18:21:27 +0000 |
parents | 45a9452579a2 |
children | c11c0da01bbc |
comparison
equal
deleted
inserted
replaced
132:e9c415839462 | 133:a6d1cc17ec33 |
---|---|
138 { | 138 { |
139 throw new InvalidDataException(String.Format("Attribute 'cat' of UnitType {0} (value: {1}) did not reference a valid category", type.ID, mainCatID)); | 139 throw new InvalidDataException(String.Format("Attribute 'cat' of UnitType {0} (value: {1}) did not reference a valid category", type.ID, mainCatID)); |
140 } | 140 } |
141 | 141 |
142 type.MainCategory = cat; | 142 type.MainCategory = cat; |
143 XmlElement statsElement = WarFoundryXmlFactoryUtils.SelectSingleElement(elem, "/race:race/race:units/race:unit/race:stats"); | 143 XmlElement statsElement = WarFoundryXmlFactoryUtils.SelectSingleElement(elem, "race:stats"); |
144 Stats unitStats = ParseUnitStats(statsElement, type.GameSystem); | 144 Stats unitStats = ParseUnitStats(statsElement, type.GameSystem); |
145 type.SetUnitStats(unitStats); | 145 type.SetUnitStats(unitStats); |
146 } | 146 } |
147 | 147 |
148 private void LoadEquipmentForUnitType(XmlElement elem, UnitType type) | 148 private void LoadEquipmentForUnitType(XmlElement elem, UnitType type) |