InstantReactionLoader.loadInstantReactionReactant C# (CSharp) Method

loadInstantReactionReactant() private method

private loadInstantReactionReactant ( XmlNode node, InstantReaction, ir ) : bool
node XmlNode
ir InstantReaction,
return bool
    private bool loadInstantReactionReactant(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 reactant definition");
            prod.setName(attr.InnerText);
          }
        else if (attr.Name == "quantity")
          {
            if (String.IsNullOrEmpty(attr.InnerText))
              Debug.Log("Warning : Empty quantity field in instant reaction reactant definition");
            prod.setQuantityFactor(float.Parse(attr.InnerText.Replace(",", ".")));
          }
          }
        ir.addReactant(prod);
        return true;
    }