Exemplo n.º 1
0
  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);
        }
      }
    }
  }
Exemplo n.º 2
0
 /* package */ void load(XMLNode node) {
   XMLNode item = node.findNodeByAttr("id", getId());
   if (item != null) {
     setState(Integer.parseInt(item.getAttribute("state")));
   }
 }