Esempio n. 1
0
 public Reveal reparse(User user, int revealId) {
   if (user.hasAccess(SimConstants.RIGHTS_SITEADMIN)) {
     Reveal r = (Reveal) Reveal.get(Reveal.class, revealId);
     r.getCreatures().clear();
     for (RevealCrit crit : PageParser.parseReveal(r.getUnparsed())) {
       r.addCreature(crit);
     }
     return r;
   } else {
     throw new SimException("access denied");
   }
 }
Esempio n. 2
0
  public Reveal addReveal(
      User user,
      Mage mage,
      String cq2class,
      Integer level,
      String kingdom,
      Integer forestSkill,
      Integer deathSkill,
      Integer airSkill,
      Integer earthSkill,
      String reveal)
      throws SimException {
    Reveal entity = null;

    makeOld(mage.getName());

    entity = new Reveal();
    entity.setUser(user);
    entity.setMage(mage);
    entity.setKingdom(kingdom);
    entity.setMageClass(cq2class);
    entity.setLevel(level);
    entity.setForestSkill(forestSkill);
    entity.setDeathSkill(deathSkill);
    entity.setAirSkill(airSkill);
    entity.setEarthSkill(earthSkill);
    entity.setUnparsed(reveal);
    entity.setTime(new Date());
    entity.saveOrUpdate();
    entity.getCreatures().clear();
    for (RevealCrit crit : PageParser.parseReveal(entity.getUnparsed())) {
      entity.addCreature(crit);
    }

    updateMageByReveal(entity);

    return entity;
  }