public static Mailable CreateFromXml(System.Xml.XmlElement n, IXCRMParser ixcrm_parser) { Mailable retval = new Mailable(); retval.id = n.GetAttribute("id"); retval.type = n.GetAttribute("type"); retval.label = n.GetAttribute("label"); retval.requirements = ixcrm_parser.ParseRequirementList(n.SelectSingleNode("./requirements") as System.Xml.XmlElement); retval.costs = ixcrm_parser.ParseCostList(n.SelectSingleNode("./costs") as System.Xml.XmlElement); retval.on_accept = ixcrm_parser.ParseModifierList(n.SelectSingleNode("./on_accept") as System.Xml.XmlElement); retval.on_give = ixcrm_parser.ParseModifierList(n.SelectSingleNode("./on_give") as System.Xml.XmlElement); retval.tags = ixcrm_parser.ParseTagList(n.SelectSingleNode("./tags") as System.Xml.XmlElement); return(retval); }
public static ShopEntry CreateFromXml(System.Xml.XmlElement n, IXCRMParser xcrm_parser) { ShopEntry retval = new ShopEntry(); retval.ikey = n.GetAttribute("ikey"); retval.label = n.GetAttribute("label"); retval.description = n.GetAttribute("description"); System.Xml.XmlElement costs_node = n.SelectSingleNode("./costs") as System.Xml.XmlElement; if (costs_node != null) { retval.costs = xcrm_parser.ParseCostList(costs_node); } // else branches not necessary as costs, modifiers and requirements are INITIALISED by definition System.Xml.XmlElement modifiers_node = n.SelectSingleNode("./modifiers") as System.Xml.XmlElement; if (modifiers_node != null) { retval.modifiers = xcrm_parser.ParseModifierList(modifiers_node); } System.Xml.XmlElement requirements_node = n.SelectSingleNode("./requirements") as System.Xml.XmlElement; if (requirements_node != null) { retval.requirements = xcrm_parser.ParseRequirementList(requirements_node); } System.Xml.XmlNodeList tag_nodes = n.SelectNodes("./tags/tag"); foreach (System.Xml.XmlElement tag_node in tag_nodes) { retval.tags.Add(tag_node.GetAttribute("value")); } return(retval); }
public XmlToShopEntry() { CrmParser_ = new XCRMParser(); }
public XCRMParser() { crm = this; }