# HG changeset patch # User IBBoard # Date 1237839701 0 # Node ID 75a44b7753d4adf2ad9f4bad3a5afc957c9be745 # Parent db951aad24b9c2161bc4b58339d5da1d53ddb071 Re #50 - Complete file loading * Set max size/points/percentage before setting minimum to avoid incorrect lowering of minimum to 0 (default integer size) diff -r db951aad24b9 -r 75a44b7753d4 api/Factories/Xml/WarFoundryXmlFactory.cs --- a/api/Factories/Xml/WarFoundryXmlFactory.cs Sun Mar 22 17:10:49 2009 +0000 +++ b/api/Factories/Xml/WarFoundryXmlFactory.cs Mon Mar 23 20:21:41 2009 +0000 @@ -394,11 +394,11 @@ { string id = elem.GetAttribute("id"); string name = elem.GetAttribute("name"); - Category cat = new Category(id, name); - cat.MinimumPercentage = GetIntValueFromAttribute(elem, "minPercentage"); + Category cat = new Category(id, name); cat.MaximumPercentage = GetIntValueFromAttribute(elem, "maxPercentage"); - cat.MinimumPoints = GetIntValueFromAttribute(elem, "minPoints"); - cat.MaximumPoints = GetIntValueFromAttribute(elem, "maxPoints"); + cat.MinimumPercentage = GetIntValueFromAttribute(elem, "minPercentage"); + cat.MaximumPoints = GetIntValueFromAttribute(elem, "maxPoints"); + cat.MinimumPoints = GetIntValueFromAttribute(elem, "minPoints"); return cat; } @@ -443,10 +443,10 @@ string id = elem.GetAttribute("id"); string name = elem.GetAttribute("typeName"); UnitType type = new UnitType(id, name, parentRace); - type.MinNumber = GetIntValueFromAttribute(elem, "minNum"); - type.MaxNumber = GetIntValueFromAttribute(elem, "maxNum"); - type.MinSize = GetIntValueFromAttribute(elem, "minSize"); - type.MaxSize = GetIntValueFromAttribute(elem, "maxSize"); + type.MaxNumber = GetIntValueFromAttribute(elem, "maxNum"); + type.MinNumber = GetIntValueFromAttribute(elem, "minNum"); + type.MaxSize = GetIntValueFromAttribute(elem, "maxSize"); + type.MinSize = GetIntValueFromAttribute(elem, "minSize"); //TODO: Add base size type.CostPerTrooper = GetIntValueFromAttribute(elem, "points"); type.BaseUnitCost = GetIntValueFromAttribute(elem, "unitPoints");