public AchievementDesc(EvUIModel model, XMLNode item, Domain domain) { mModel = model; setId(item.getAttribute("id")); setName(item.getAttribute("name")); setDomain(domain); XMLNode child = item.findChild("condition"); if (child != null) { mCond = new Condition(child); } child = item.findChild("description"); if (child != null) { setDescription(child.getAttribute(XMLNode.TEXT_ATTR)); } for (int i = 0; i < item.getChildCount(); i++) { child = item.getChild(i); if (child.getName().equals("enable")) { String featureId = child.getAttribute("feature"); if (featureId != null) { FeatureDesc feature = model.getFeature(featureId); if (feature != null) { mFeatures.add(feature); } } String coinId = child.getAttribute("coin"); if (coinId != null) { mCoins.add(coinId); } } } }
/* package */ void load(XMLNode node) { XMLNode item = node.findNodeByAttr("id", getId()); if (item != null) { setState(Integer.parseInt(item.getAttribute("state"))); } }