Mercurial > repos > IBDev-IBBoard.WarFoundry.API
changeset 45:75a44b7753d4
Re #50 - Complete file loading
* Set max size/points/percentage before setting minimum to avoid incorrect lowering of minimum to 0 (default integer size)
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 23 Mar 2009 20:21:41 +0000 |
parents | db951aad24b9 |
children | a5855fcd75ab |
files | api/Factories/Xml/WarFoundryXmlFactory.cs |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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");