Exemple #1
0
 public PCClassLevel getOriginalClassLevel(int lvl) {
   if (!levelMap.containsKey(lvl)) {
     PCClassLevel classLevel = new PCClassLevel();
     classLevel.put(IntegerKey.LEVEL, lvl);
     classLevel.setName(getDisplayName() + "(" + lvl + ")");
     classLevel.put(StringKey.QUALIFIED_KEY, getQualifiedKey());
     classLevel.put(ObjectKey.SOURCE_CAMPAIGN, get(ObjectKey.SOURCE_CAMPAIGN));
     classLevel.put(StringKey.SOURCE_PAGE, get(StringKey.SOURCE_PAGE));
     classLevel.put(StringKey.SOURCE_LONG, get(StringKey.SOURCE_LONG));
     classLevel.put(StringKey.SOURCE_SHORT, get(StringKey.SOURCE_SHORT));
     classLevel.put(StringKey.SOURCE_WEB, get(StringKey.SOURCE_WEB));
     classLevel.put(ObjectKey.SOURCE_DATE, get(ObjectKey.SOURCE_DATE));
     classLevel.put(ObjectKey.TOKEN_PARENT, this);
     levelMap.put(lvl, classLevel);
   }
   return levelMap.get(lvl);
 }
Exemple #2
0
 public void copyLevelsFrom(PCClass cl) {
   for (Map.Entry<Integer, PCClassLevel> me : cl.levelMap.entrySet()) {
     try {
       PCClassLevel lvl = me.getValue().clone();
       lvl.put(StringKey.QUALIFIED_KEY, getQualifiedKey());
       lvl.put(ObjectKey.SOURCE_CAMPAIGN, get(ObjectKey.SOURCE_CAMPAIGN));
       lvl.put(StringKey.SOURCE_PAGE, get(StringKey.SOURCE_PAGE));
       lvl.put(StringKey.SOURCE_LONG, get(StringKey.SOURCE_LONG));
       lvl.put(StringKey.SOURCE_SHORT, get(StringKey.SOURCE_SHORT));
       lvl.put(StringKey.SOURCE_WEB, get(StringKey.SOURCE_WEB));
       lvl.put(ObjectKey.SOURCE_DATE, get(ObjectKey.SOURCE_DATE));
       lvl.put(ObjectKey.TOKEN_PARENT, this);
       lvl.setName(getDisplayName() + "(" + lvl.get(IntegerKey.LEVEL) + ")");
       lvl.ownBonuses(this);
       levelMap.put(me.getKey(), lvl);
     } catch (CloneNotSupportedException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
   }
 }