예제 #1
0
 public Element createNpcElement(Fight f, NumberFormat nf) {
   Element npcElement = doc.createElement(npcTag);
   npcElement.setAttribute(idTag, nf.format(f.getMobID()));
   npcElement.setAttribute(nameTag, f.getName());
   npcElement.setAttribute(guidTag, f.getGuid());
   npcElement.setAttribute(monthTag, nf.format((int) f.getStartEvent().month));
   npcElement.setAttribute(dayTag, nf.format((int) f.getStartEvent().day));
   npcElement.setAttribute(hourTag, nf.format((int) f.getStartEvent().hour));
   npcElement.setAttribute(minuteTag, nf.format((int) f.getStartEvent().minute));
   npcElement.setAttribute(secondTag, nf.format(f.getStartEvent().second));
   return npcElement;
 }
예제 #2
0
  public Document makeDocument() {
    Element fightNode = doc.createElement(fightTag);
    fightNode.setAttribute(nameTag, fight.getName());
    fightNode.setAttribute(guidTag, fight.getGuid());
    addFightInfo(fightNode);

    Element victimNode = doc.createElement(victimTag);
    FightParticipant victim = fight.getVictim();
    XMLFightParticipant victimXP = new XMLFightParticipant(doc, victim, fight);
    Node victimParticipantNode = victimXP.makeNode();
    fightNode.appendChild(victimNode);
    victimNode.appendChild(victimParticipantNode);

    List<FightParticipant> parts = fight.getParticipants();
    for (FightParticipant p : parts) {
      XMLFightParticipant xp = new XMLFightParticipant(doc, p, fight);
      Node n = xp.makeNode();
      fightNode.appendChild(n);
    }
    doc.appendChild(fightNode);
    return doc;
  }