diff api/Factories/Xml/WarFoundryXmlRaceFactory.cs @ 55:9080366031c0

Re #9 - Refactor for small methods * Replace use of obsolete constructors with small constructors and property setting
author IBBoard <dev@ibboard.co.uk>
date Sun, 05 Apr 2009 19:21:51 +0000
parents 1b35eed503ef
children e6200220ece3
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sun Apr 05 13:45:23 2009 +0000
+++ b/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sun Apr 05 19:21:51 2009 +0000
@@ -44,7 +44,7 @@
 			string subid = elem.GetAttribute("subid");
 			string systemID = elem.GetAttribute("system");
 			string name = elem.GetAttribute("name");
-			Race race = new Race(id, subid, name, systemID, mainFactory);
+			Race race = new Race(id, subid, name, WarFoundryLoader.GetDefault().GetGameSystem(systemID), mainFactory);
 			StoreExtraData(race, elem);
 			return race;
 		}
@@ -155,7 +155,7 @@
 		{
 			string id = elem.GetAttribute("id");
 			string name = elem.GetAttribute("name");
-			double cost = 0, min = 0, max = 0;
+			double cost = 0;
 			ArmourType armourType;
 			
 			try
@@ -177,8 +177,11 @@
 			}
 			
 			//TODO: Parse equipment stats if there are any
+			EquipmentItem item = new EquipmentItem(id, name, race);
+			item.Cost = cost;
+			item.ItemArmourType = armourType;
 			
-			return new EquipmentItem(id, name, cost, min, max, armourType, race);
+			return item;
 		}
 		
 		private Ability CreateAbilityFromElement(XmlElement elem, Race race)