@Override public void storeInBundle(Bundle bundle) { super.storeInBundle(bundle); heroClass.storeInBundle(bundle); subClass.storeInBundle(bundle); bundle.put(ATTACK, attackSkill); bundle.put(DEFENSE, defenseSkill); bundle.put(STRENGTH, STR); bundle.put(LEVEL, lvl); bundle.put(EXPERIENCE, exp); belongings.storeInBundle(bundle); }
@Override public void restoreFromBundle(Bundle bundle) { super.restoreFromBundle(bundle); heroClass = HeroClass.restoreInBundle(bundle); subClass = HeroSubClass.restoreInBundle(bundle); attackSkill = bundle.getInt(ATTACK); defenseSkill = bundle.getInt(DEFENSE); STR = bundle.getInt(STRENGTH); updateAwareness(); lvl = bundle.getInt(LEVEL); exp = bundle.getInt(EXPERIENCE); belongings.restoreFromBundle(bundle); }
public String className() { return subClass == null || subClass == HeroSubClass.NONE ? heroClass.title() : subClass.title(); }