private bool storeMolecule(XmlNode node, Molecule.eType type, ArrayList molecules) { Molecule mol = new Molecule(); mol.setType(type); foreach (XmlNode attr in node) { switch (attr.Name) { case "name": mol.setName(attr.InnerText); break; case "description": mol.setDescription(attr.InnerText); break; case "concentration": mol.setConcentration(float.Parse(attr.InnerText.Replace(",", "."))); break; case "degradationRate": mol.setDegradationRate(float.Parse(attr.InnerText.Replace(",", "."))); break; case "size": mol.setSize(float.Parse(attr.InnerText.Replace(",", "."))); break; } } molecules.Add(mol); //FIXME : create a real reaction for degradation with rate and name // _reactions.AddLast(new Degradation(mol.getDegradationRate(), mol.getName())); return true; }