public static void restoreFromBundle( Bundle bundle ) { records = new ArrayList<>(); for (Bundlable rec : bundle.getCollection( RECORDS ) ) { records.add( (Record) rec ); } }
public static void restoreFromBundle( Bundle bundle ) { records = new ArrayList<>(); for (Bundlable rec : bundle.getCollection( RECORDS ) ) { records.add( (Record) rec ); } }
public static void restoreFromBundle( Bundle bundle ) { records = new ArrayList<Record>(); for (Bundlable rec : bundle.getCollection( JOURNAL ) ) { records.add( (Record) rec ); } }
public static void loadAssortment( Bundle bundle ) { kits = new ArrayList<>(); for (Bundlable item : bundle.getCollection( KITS )) { if( item != null ){ kits.add( (Item)item ); } }; ammo1 = new ArrayList<>(); for (Bundlable item : bundle.getCollection( AMMO1 )) { if( item != null ){ ammo1.add( (Item)item ); } }; ammo2 = new ArrayList<>(); for (Bundlable item : bundle.getCollection( AMMO2 )) { if( item != null ){ ammo2.add( (Item)item ); } }; }
@SuppressWarnings("unchecked") @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); rooms = new HashSet<Room>( (Collection<? extends Room>) (Object) bundle.getCollection( "rooms" ) ); for (Room r : rooms) { if (r.type == Type.WEAK_FLOOR) { weakFloorCreated = true; break; } } }
@Override public void restoreFromBundle(Bundle bundle) { items = new ArrayList<MissileWeapon>((Collection<MissileWeapon>)((Collection<?>)bundle.getCollection( ITEMS ))); super.restoreFromBundle( bundle ); } }
@SuppressWarnings("unchecked") @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); items = new ArrayList<Item>( (Collection<? extends Item>) (Object) bundle.getCollection( ITEMS ) ); // adjustStats( bundle.getInt( LEVEL ) ); }
@Override public void restoreFromBundle(Bundle bundle) { items = new ArrayList<MissileWeapon>((Collection<MissileWeapon>)((Collection<?>)bundle.getCollection( ITEMS ))); super.restoreFromBundle( bundle ); } }
public void restorePlaceholders(Bundle bundle){ Collection<Bundlable> placeholders = bundle.getCollection(PLACEHOLDERS); boolean[] placements = bundle.getBooleanArray( PLACEMENTS ); int i = 0; for (Bundlable item : placeholders){ while (!placements[i]) i++; setSlot( i, (Item)item ); i++; } }
@Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); for (Bundlable item : bundle.getCollection( ITEMS )) { if (item != null) ((Item)item).collect( this ); }; }
public void restorePlaceholders(Bundle bundle){ Collection<Bundlable> placeholders = bundle.getCollection(PLACEHOLDERS); boolean[] placements = bundle.getBooleanArray( PLACEMENTS ); int i = 0; for (Bundlable item : placeholders){ while (!placements[i]) i++; setSlot( i, (Item)item ); i++; } }
@Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); for (Bundlable item : bundle.getCollection( ITEMS )) { if( item != null) ((Item)item).collect( this ); }; }
@Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); for (Bundlable item : bundle.getCollection( ITEMS )) { if (item != null) ((Item)item).collect( this ); }; }
@Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); state = bundle.getEnum( STATE, State.class ); //in some states tengu won't be in the world, in others he will be. if (state == State.START || state == State.MAZE) { tengu = (Tengu)bundle.get( TENGU ); } else { for (Mob mob : mobs){ if (mob instanceof Tengu) { tengu = (Tengu) mob; break; } } } for (Bundlable item : bundle.getCollection(STORED_ITEMS)){ storedItems.add( (Item)item ); } }
@SuppressWarnings("unchecked") @Override public void restoreFromBundle( Bundle bundle ) { if (bundle.contains( ITEMS )) { items = new ArrayList<>((Collection<Item>) ((Collection<?>) bundle.getCollection(ITEMS))); } adjustStats( bundle.getInt( LEVEL ) ); super.restoreFromBundle(bundle); }
@SuppressWarnings("unchecked") @Override public void restoreFromBundle( Bundle bundle ) { hp = bundle.getInt( HP ); pos = bundle.getInt( POS ); type = Type.valueOf( bundle.getString( TYPE ) ); items = new LinkedList<Item>( (Collection<? extends Item>)(Object) bundle.getCollection( ITEMS ) ); }
@SuppressWarnings("unchecked") @Override public void restoreFromBundle( Bundle bundle ) { if (bundle.contains( ITEMS )) { items = new ArrayList<>((Collection<Item>) ((Collection<?>) bundle.getCollection(ITEMS))); } adjustStats( bundle.getInt( LEVEL ) ); super.restoreFromBundle(bundle); }
@Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); pos = bundle.getInt( POS ); HP = bundle.getInt( TAG_HP ); HT = bundle.getInt( TAG_HT ); for (Bundlable b : bundle.getCollection( BUFFS )) { if (b != null) { ((Buff)b).attachOnLoad( this ); } } }
@SuppressWarnings("unchecked") @Override public void restoreFromBundle( Bundle bundle ) { pos = bundle.getInt( POS ); seen = bundle.getBoolean( SEEN ); type = Type.valueOf( bundle.getString( TYPE ) ); items = new LinkedList<Item>( (Collection<Item>) ((Collection<?>) bundle.getCollection( ITEMS )) ); items.removeAll(Collections.singleton(null)); //remove any document pages that either don't exist anymore or that the player already has for (Item item : items.toArray(new Item[0])){ if (item instanceof DocumentPage && ( !((DocumentPage) item).document().pages().contains(((DocumentPage) item).page()) || ((DocumentPage) item).document().hasPage(((DocumentPage) item).page()))){ items.remove(item); } } haunted = bundle.getBoolean( HAUNTED ); }
@SuppressWarnings("unchecked") @Override public void restoreFromBundle( Bundle bundle ) { pos = bundle.getInt( POS ); seen = bundle.getBoolean( SEEN ); type = Type.valueOf( bundle.getString( TYPE ) ); items = new LinkedList( bundle.getCollection( ITEMS ) ); items.removeAll(Collections.singleton(null)); //remove any document pages that either don't exist anymore or that the player already has for (Item item : items.toArray(new Item[0])){ if (item instanceof DocumentPage && ( !((DocumentPage) item).document().pages().contains(((DocumentPage) item).page()) || ((DocumentPage) item).document().hasPage(((DocumentPage) item).page()))){ items.remove(item); } } haunted = bundle.getBoolean( HAUNTED ); }