comparison api/Factories/Xml/WarFoundryXmlRaceFactory.cs @ 90:bd2aaa9a61df

Re #50: Complete loading of core XML file * Fix remaining bugs from trying to load UnitEquipmentItem values from wrong element * Add type cast to fix infinite loop
author IBBoard <dev@ibboard.co.uk>
date Sat, 01 Aug 2009 21:40:53 +0000
parents 110a7b0bcab5
children 571d8ddc7d9a
comparison
equal deleted inserted replaced
89:cb3759c3ea19 90:bd2aaa9a61df
155 EquipmentItem equipItem = type.Race.GetEquipmentItem(id); 155 EquipmentItem equipItem = type.Race.GetEquipmentItem(id);
156 156
157 if (equipItem!=null) 157 if (equipItem!=null)
158 { 158 {
159 UnitEquipmentItem unitEquipItem = new UnitEquipmentItem(equipItem); 159 UnitEquipmentItem unitEquipItem = new UnitEquipmentItem(equipItem);
160 unitEquipItem.MutexGroup = elem.GetAttribute("exclusivityGroup"); 160 unitEquipItem.MutexGroup = equip.GetAttribute("exclusivityGroup");
161 unitEquipItem.RoundNumberUp = elem.GetAttribute("roundDirection").Equals("up"); 161 unitEquipItem.RoundNumberUp = equip.GetAttribute("roundDirection").Equals("up");
162 162
163 163
164 try 164 try
165 { 165 {
166 unitEquipItem.IsRequired = bool.Parse(equip.GetAttribute("required")); 166 unitEquipItem.IsRequired = bool.Parse(equip.GetAttribute("required"));