Exemplo n.º 1
0
  public String greetServer(Troll input) throws IllegalArgumentException {
    // On assigne un id au troll
    input.setId(list.size());
    // On ajoute le troll a la list
    list.add(input);
    // On écrit la list dans le fichier XML
    XMLtools.ecrire(list, this.getServletContext().getRealPath(filePath));

    return "OK";
  }
Exemplo n.º 2
0
  /** Modification d'un troll */
  @Override
  public String greetServer(String id, Troll troll) throws IllegalArgumentException {
    // TODO Auto-generated method stub

    // On met a jour les informations
    list.get(troll.getId()).setAttaque(troll.getAttaque());
    list.get(troll.getId()).setDegats(troll.getDegats());
    list.get(troll.getId()).setEsquive(troll.getEsquive());
    list.get(troll.getId()).setNom(troll.getNom());
    list.get(troll.getId()).setRace(troll.getRace());
    list.get(troll.getId()).setRegeneration(troll.getRegeneration());
    list.get(troll.getId()).setURL(troll.getURL());
    list.get(troll.getId()).setVie(troll.getVie());
    list.get(troll.getId()).setComptence1(troll.getComptence1());
    list.get(troll.getId()).setComptence2(troll.getComptence2());
    XMLtools.ecrire(list, this.getServletContext().getRealPath(filePath)); // On réécri le XML
    return "OK";
  }