diff api/Factories/Xml/WarFoundryXmlRaceFactory.cs @ 67:e6200220ece3

Re #50 - Complete core loading of WarFoundry XML files * Clean up stat loading for game systems and unit types * Delete rogue character that stopped code compiling
author IBBoard <dev@ibboard.co.uk>
date Sat, 25 Apr 2009 14:59:23 +0000
parents 9080366031c0
children 10d14a7051d5
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sat Apr 11 14:53:45 2009 +0000
+++ b/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sat Apr 25 14:59:23 2009 +0000
@@ -116,7 +116,6 @@
 		
 		private Stats ParseUnitStats(XmlElement elem, GameSystem system)
 		{
-			List<Stat> statsList = new List<Stat>();
 			String statsID = elem.GetAttribute("statSet");
 			SystemStats statsSet;
 			
@@ -133,21 +132,10 @@
 			
 			foreach (XmlElement stat in WarFoundryXmlFactoryUtils.SelectNodes(elem, "race:stat"))
 			{
-				String statID = stat.GetAttribute("name");
-				StatSlot slot = statsSet[statID];
-				
-				if (slot!=null)
-				{
-					statsList.Add(new Stat(slot, stat.InnerText));
-				}
-				else
-				{
-					throw new InvalidFileException("The stat "+statID+" was not found in stats set "+statsID);
-				}
+				String statName = stat.GetAttribute("name");
+				stats.SetStatValue(statName, stat.InnerText);
 			}
 			
-			stats.SetStats(statsList);
-			
 			return stats;
 		}