private bool loadInstantReactionProduct(XmlNode node, InstantReaction ir)
{
Product prod = new Product();
foreach (XmlNode attr in node)
{
if (attr.Name == "name")
{
if (String.IsNullOrEmpty(attr.InnerText))
Debug.Log("Warning : Empty name field in instant reaction product definition");
prod.setName(attr.InnerText);
}
else if (attr.Name == "quantity")
{
if (String.IsNullOrEmpty(attr.InnerText))
Debug.Log("Warning : Empty quantity field in instant reaction product definition");
prod.setQuantityFactor(float.Parse(attr.InnerText.Replace(",", ".")));
}
}
ir.addProduct(prod);
return true;
}