Package org.zachtaylor.jnodalxml

Examples of org.zachtaylor.jnodalxml.XmlNode


      direction = "down";
    }
  }

  public XmlNode toXml() {
    XmlNode node = new XmlNode(XML_NODE_NAME);
    node.setAttribute("map", map);
    node.setAttribute("direction", direction);
    node.setAttribute("left", getLeft());
    node.setAttribute("top", getTop());
    node.setAttribute("width", getWidth());
    node.setAttribute("height", getHeight());
    node.setSelfClosing(true);

    return node;
  }
View Full Code Here


    map = new Map(name);
  }

  private void parse() {
    try {
      XmlNode data = XmlParser.parse(new File(mappath, map.getName() + ".tmx")).get(1);

      parseMapDimensions(data);

      for (XmlNode objectLayer : data.getChildren("objectgroup")) {
        for (XmlNode objectNode : objectLayer.getAllChildren()) {
          parseEntity(objectNode);
        }
      }
    }
View Full Code Here

    while (!possible.isEmpty() && _count < movecount)
      add(possible.remove((int) (Math.random() * possible.size())));
  }

  public XmlNode toXml() {
    XmlNode node = new XmlNode(XML_NODE_NAME);

    for (Move m : this) {
      node.addChild(m.toXml());
    }

    return node;
  }
View Full Code Here

    checkNewMoves();
  }

  public XmlNode toXml() {
    XmlNode node = new XmlNode(XML_NODE_NAME);

    if (_name != null) {
      node.setAttribute("name", _name);
    }

    node.setAttribute("number", _number);
    node.setAttribute("level", _level);
    node.setAttribute("xp", _xp);
    node.setAttribute("ot", _ot);
    node.setAttribute("has_original_trainer", _hasOriginalTrainer);

    XmlNode conditionNode = new XmlNode("condition");
    conditionNode.setValue(conditionEffects.toString());
    node.addChild(conditionNode);

    node.addChild(_stats.toXml());
    node.addChild(_moves.toXml());
View Full Code Here

    // TODO : add dragon rage, bide
    return false;
  }

  public XmlNode toXml() {
    XmlNode node = new XmlNode(XML_NODE_NAME);

    node.setAttribute("number", number());
    node.setAttribute("pp", _pp);
    node.setAttribute("ppmax", _ppMax);
    node.setAttribute("enabled", _enabled);
    node.setSelfClosing(true);

    return node;
  }
View Full Code Here

    return _data[box];
  }

  public XmlNode toXml() {
    XmlNode node = new XmlNode(XML_NODE_NAME);

    for (PokemonStorageUnit psu : _data) {
      node.addChild(psu.toXml());
    }

    return node;
  }
View Full Code Here

    return answer;
  }

  public XmlNode toXml() {
    XmlNode node = new XmlNode(XML_NODE_NAME);

    for (Pokemon p : this) {
      node.addChild(p.toXml());
    }

    return node;
  }
View Full Code Here

    return data;
  }

  public XmlNode toXML() {
    XmlNode node = new XmlNode(XML_NODE_NAME);

    node.setValue(_events.toString());

    return node;
  }
View Full Code Here

    return s;
  }

  public XmlNode toXml() {
    XmlNode node = new XmlNode(XML_NODE_NAME);

    if (_rivalName != null) {
      node.setAttribute("rival", _rivalName);
    }

    if (_pokemon != null) {
      node.setAttribute("starter", _pokemon);
    }

    XmlNode eventNode = new XmlNode("events");
    eventNode.setValue(_events.toString());
    node.addChild(eventNode);

    XmlNode trainerNode = new XmlNode("trainers");
    trainerNode.setValue(_trainers.toString());
    node.addChild(trainerNode);

    return node;
  }
View Full Code Here

    p.setTrainerName(getName());
    return party().add(p);
  }

  public XmlNode toXml() {
    XmlNode node = new XmlNode(XML_NODE_NAME);

    node.setAttribute("name", _name);
    node.setAttribute("gym", _isGym);
    node.addChild(_party.toXml());

    return node;
  }
View Full Code Here

TOP

Related Classes of org.zachtaylor.jnodalxml.XmlNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.