Mercurial > repos > IBBoard.WarFoundry.API
comparison api/Factories/Xml/WarFoundryXmlRaceFactory.cs @ 128:45a9452579a2
Fixes #50: Complete core loading of WarFoundry XML files
* Add exceptions on invalid data - completes WarFoundry 0.1 loading needs
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 26 Aug 2009 18:37:55 +0000 |
parents | 2f3cafb69799 |
children | a6d1cc17ec33 |
comparison
equal
deleted
inserted
replaced
127:b04512847424 | 128:45a9452579a2 |
---|---|
222 throw new InvalidFileException("Attribute 'costRounding' of unit equipment item " + id + " for " + type.Name + " was not a valid rounding type", e); | 222 throw new InvalidFileException("Attribute 'costRounding' of unit equipment item " + id + " for " + type.Name + " was not a valid rounding type", e); |
223 } | 223 } |
224 } | 224 } |
225 else | 225 else |
226 { | 226 { |
227 //TODO: Warn about missing item | 227 throw new InvalidFileException("Equipment item with ID '" + id + "' was required by " + type.Name + " but was not found"); |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 } | 231 } |
232 | 232 |
251 { | 251 { |
252 type.AddContainedUnitType(containedType); | 252 type.AddContainedUnitType(containedType); |
253 } | 253 } |
254 else | 254 else |
255 { | 255 { |
256 // TODO: Warn on invalid data, but don't exception | 256 throw new InvalidFileException("Unit type " + type.Name + " tried to contain undefined unit with ID "+id); |
257 } | 257 } |
258 } | 258 } |
259 } | 259 } |
260 | 260 |
261 private void LoadRequirementsForUnitType(XmlElement elem, UnitType type) | 261 private void LoadRequirementsForUnitType(XmlElement elem, UnitType type) |