public object DOMParse(XmlElement element, params object[] parameters) { XmlElement tmpXmlElement; var completable = new Completable(); completable.setId(element.GetAttribute("id")); completable.setRepeatable(element.GetAttribute("repeatable") == "true"); switch (element.GetAttribute("type")) { case "combat": completable.setType(Completable.TYPE_COMBAT); break; case "completable": completable.setType(Completable.TYPE_COMPLETABLE); break; case "game": completable.setType(Completable.TYPE_GAME); break; case "level": completable.setType(Completable.TYPE_LEVEL); break; case "quest": completable.setType(Completable.TYPE_QUEST); break; case "race": completable.setType(Completable.TYPE_RACE); break; case "session": completable.setType(Completable.TYPE_SESSION); break; case "stage": completable.setType(Completable.TYPE_STAGE); break; case "storynode": completable.setType(Completable.TYPE_STORYNODE); break; default: completable.setType(Completable.TYPE_COMPLETABLE); break; } tmpXmlElement = (XmlElement)element.SelectSingleNode("start-milestone"); if (tmpXmlElement != null) { completable.setStart(parseMilestone(tmpXmlElement, parameters)); } tmpXmlElement = (XmlElement)element.SelectSingleNode("end-milestone"); if (tmpXmlElement != null) { completable.setEnd(parseMilestone(tmpXmlElement, parameters)); } tmpXmlElement = (XmlElement)element.SelectSingleNode("progress"); if (tmpXmlElement != null) { completable.setProgress(parseProgress(tmpXmlElement, parameters)); } tmpXmlElement = (XmlElement)element.SelectSingleNode("score"); if (tmpXmlElement != null) { completable.setScore(parseScore(tmpXmlElement, parameters)); } return(completable); }
public void setRepeatable(bool repeatable) { completable.setRepeatable(repeatable); }