diff api/Factories/Xml/WarFoundryXmlRaceFactory.cs @ 81:032b174fc17a

Re #10 - Refactoring for readability * Remove "trainwreck code" by making Unit and UnitType publish methods to get arrays of stats * Remove "trainwreck code" by making Unit, UnitType and Stats publish methods to get value of one stat * Make factory use new methods
author IBBoard <dev@ibboard.co.uk>
date Wed, 27 May 2009 19:43:09 +0000
parents 0303ac938fc5
children 46ad6f478203
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Tue May 19 19:00:48 2009 +0000
+++ b/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Wed May 27 19:43:09 2009 +0000
@@ -142,7 +142,8 @@
 			
 			type.MainCategory = cat;
 			XmlElement statsElement = WarFoundryXmlFactoryUtils.SelectSingleElement(elem, "/race:race/race:units/race:unit/race:stats");
-			type.UnitStats = ParseUnitStats(statsElement, type.GameSystem);
+			Stats unitStats = ParseUnitStats(statsElement, type.GameSystem);
+			type.SetUnitStats(unitStats);
 		}
 
 		private void LoadEquipmentForUnitType(XmlElement elem, UnitType type)