comparison api/Factories/Xml/WarFoundryXmlSaver.cs @ 122:571eee2b7b30

Re #54: Add army loading * Fix army loading by writing out the correct ID for the equipment items when we save
author IBBoard <dev@ibboard.co.uk>
date Sun, 23 Aug 2009 11:07:47 +0000
parents d0c60b3204c1
children c60fd5664698
comparison
equal deleted inserted replaced
121:53654e938982 122:571eee2b7b30
143 } 143 }
144 144
145 private XmlElement CreateEquipmentElement(UnitEquipmentItem item, Unit unit, XmlDocument doc) 145 private XmlElement CreateEquipmentElement(UnitEquipmentItem item, Unit unit, XmlDocument doc)
146 { 146 {
147 XmlElement equipmentItemElem = doc.CreateElement("equipItem"); 147 XmlElement equipmentItemElem = doc.CreateElement("equipItem");
148 equipmentItemElem.SetAttribute("id", item.EquipmentItemID); 148 equipmentItemElem.SetAttribute("id", item.ID);
149 equipmentItemElem.SetAttribute("amount", unit.GetEquipmentAmount(item).ToString()); 149 equipmentItemElem.SetAttribute("amount", unit.GetEquipmentAmount(item).ToString());
150 equipmentItemElem.SetAttribute("amountType", unit.GetEquipmentAmountIsRatio(item) ? "ratio" : "fixed"); 150 equipmentItemElem.SetAttribute("amountType", unit.GetEquipmentAmountIsRatio(item) ? "ratio" : "fixed");
151 return equipmentItemElem; 151 return equipmentItemElem;
152 } 152 }
153 153