public void ReadXml(XmlReader reader) { ressource = new Ressource(); if (reader.ReadToDescendant("HoldedRessource")) { while (reader.MoveToContent() == XmlNodeType.Element && reader.LocalName == "HoldedRessource") { ressource.ReadXml(reader); } } reader.Read(); }
public void ReadXml(XmlReader reader) { timeToProduce = Convert.ToInt32(reader["Speed"]); timeSinceLastProduction = Convert.ToInt32(reader["LastProd"]); ressource = new Ressource(); if (reader.ReadToDescendant("GeneratedRessource")) { while (reader.MoveToContent() == XmlNodeType.Element && reader.LocalName == "GeneratedRessource") { ressource.ReadXml(reader); } } reader.Read(); }