comparison api/Factories/Xml/WarFoundryXmlRaceFactory.cs @ 154:4a02c07278e7

Re #185: Problems with decimals in race definitions * Fix race factory so that it parses unit costs as doubles, not ints Also: * Line ending clean-up
author IBBoard <dev@ibboard.co.uk>
date Mon, 28 Sep 2009 19:32:52 +0000
parents 0c0e14f03785
children 62ff1ac132d2
comparison
equal deleted inserted replaced
153:dd892567f054 154:4a02c07278e7
127 type.MaxNumber = XmlTools.GetIntValueFromAttribute(elem, "maxNum"); 127 type.MaxNumber = XmlTools.GetIntValueFromAttribute(elem, "maxNum");
128 type.MinNumber = XmlTools.GetIntValueFromAttribute(elem, "minNum"); 128 type.MinNumber = XmlTools.GetIntValueFromAttribute(elem, "minNum");
129 type.MaxSize = XmlTools.GetIntValueFromAttribute(elem, "maxSize"); 129 type.MaxSize = XmlTools.GetIntValueFromAttribute(elem, "maxSize");
130 type.MinSize = XmlTools.GetIntValueFromAttribute(elem, "minSize"); 130 type.MinSize = XmlTools.GetIntValueFromAttribute(elem, "minSize");
131 type.BaseSize = XmlTools.GetIntValueFromAttribute(elem, "baseSize"); 131 type.BaseSize = XmlTools.GetIntValueFromAttribute(elem, "baseSize");
132 type.CostPerTrooper = XmlTools.GetIntValueFromAttribute(elem, "points"); 132 type.CostPerTrooper = XmlTools.GetDoubleValueFromAttribute(elem, "points");
133 type.BaseUnitCost = XmlTools.GetIntValueFromAttribute(elem, "unitPoints"); 133 type.BaseUnitCost = XmlTools.GetDoubleValueFromAttribute(elem, "unitPoints");
134 string mainCatID = elem.GetAttribute("cat"); 134 string mainCatID = elem.GetAttribute("cat");
135 Category cat = type.Race.GetCategory(mainCatID); 135 Category cat = type.Race.GetCategory(mainCatID);
136 136
137 if (cat == null) 137 if (cat == null)
138 { 138 {