@Override public void ownBonuses(Object owner) throws CloneNotSupportedException { super.ownBonuses(owner); for (PCClassLevel pcl : this.getOriginalClassLevelCollection()) { pcl.ownBonuses(owner); } }
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(); } } }