public void storeInBundle(Bundle bundle) { backpack.storeInBundle(bundle); bundle.put(WEAPON, weapon); bundle.put(ARMOR, armor); bundle.put(MISC1, misc1); bundle.put(MISC2, misc2); }
public Belongings(Hero owner) { this.owner = owner; backpack = new Bag() { { name = "backpack"; size = BACKPACK_SIZE; } }; backpack.owner = owner; }
public void restoreFromBundle(Bundle bundle) { backpack.clear(); backpack.restoreFromBundle(bundle); weapon = (KindOfWeapon) bundle.get(WEAPON); if (weapon != null) { weapon.activate(owner); } armor = (Armor) bundle.get(ARMOR); misc1 = (KindofMisc) bundle.get(MISC1); if (misc1 != null) { misc1.activate(owner); } misc2 = (KindofMisc) bundle.get(MISC2); if (misc2 != null) { misc2.activate(owner); } }