public object DOMParse(XmlElement element, params object[] parameters) { XmlNodeList resourcess = element.SelectNodes("resources"), descriptions = element.SelectNodes("description"); XmlElement documentation = element.SelectSingleNode("documentation") as XmlElement; Atrezzo atrezzo = new Atrezzo(element.GetAttribute("id")); // DOCUMENTATION if (documentation != null) { atrezzo.setDocumentation(documentation.InnerText); } // RESOURCES foreach (var res in DOMParserUtility.DOMParse <ResourcesUni>(resourcess, parameters)) { atrezzo.addResources(res); } // DESCRIPTIONS atrezzo.setDescriptions(DOMParserUtility.DOMParse <Description>(descriptions, parameters).ToList()); return(atrezzo); }
/** * Returns an atrezzo item with the given id. * * @param atrezzoId * Atrezzo id * @return Atrezzo item requested, null if it was not found */ public Atrezzo getAtrezzo(string atrezzoId) { Atrezzo selectedAtrezzo = null; foreach (Atrezzo at in getObjects <Atrezzo> ()) { if (at.getId().Equals(atrezzoId)) { selectedAtrezzo = at; } } return(selectedAtrezzo); }
/** * Adds an atrezzo item to the list of atrezzo items in the game * * @param atrezzo * the atrezzo item to add */ public void addAtrezzo(Atrezzo atrezzo) { getAtrezzo().Add(atrezzo); }
/* * @Override * public Object clone() throws CloneNotSupportedException * { * * Atrezzo a = (Atrezzo) super.clone( ); * return a; * } */ public override object Clone() { Atrezzo a = (Atrezzo)base.Clone(); return(a); }