changeset 450:8811737baebf

Fixes #352: Test/fix cyclic references in unit types * Tell the Race it has a new UnitType earlier to resolve load loops * Update example data file to one that uses all requirements, but caused cyclic issues
author IBBoard <dev@ibboard.co.uk>
date Sun, 22 Jan 2012 19:17:06 +0000
parents ba6c762cdfc3
children 676f5ce04176
files API/Factories/Xml/WarFoundryXmlRaceFactory.cs data/Empire.race
diffstat 2 files changed, 1 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/API/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sat Jan 21 20:40:28 2012 +0000
     1.2 +++ b/API/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sun Jan 22 19:17:06 2012 +0000
     1.3 @@ -156,6 +156,7 @@
     1.4  			string name = elem.GetAttribute("typeName");
     1.5  			UnitType type = new UnitType(id, name, parentRace);
     1.6  			LoadCoreValuesForUnitType(elem, type);
     1.7 +			parentRace.AddUnitType(type);
     1.8  			LoadEquipmentSlotsForUnitType(elem, type);
     1.9  			LoadEquipmentForUnitType(elem, type);
    1.10  			LoadAbilitiesForUnitType(elem, type);
    1.11 @@ -163,7 +164,6 @@
    1.12  			LoadRequirementsForUnitType(elem, type);
    1.13  			LoadExtraDataForUnitType(elem, type);
    1.14  			LoadNotesForUnitType(elem, type);
    1.15 -			parentRace.AddUnitType(type);
    1.16  			return type;
    1.17  		}
    1.18  
     2.1 Binary file data/Empire.race has changed