I see the code with presumedObject.Deserialize but not all the things in Deserialize are "mergable".
There are 2 issues here.
1) is I see a lot of default values if the node or attribute isn't present in the XML. I.e the level
Code:
this.Level = attribute5 != null ? Convert.ToInt32(attribute5.InnerText) : 1;
So it won't merge the level but reset it to 1 when it sees the new definition with just the equipment node
If it was something like
Code:
if(attribute5 != null)
{
this.Level = Convert.ToInt32(attribute5.InnerText);
}
else if(!this.Level.HasValue)
{
this.Level = 1;
}
it would have worked, assuming Level was int?.
2) The loading only adds equipment so the first definition of imperial_recruit will add the equipment, but there is no way for me to remove it, at best I can override the slot with a different item, but that might not work since the behavior is probably undefined if a unit's equipment has 2 items with the same slot.
I tried going the code route but there's no RemoveEquipment on the units