@Override public void storeInBundle(Bundle bundle) { super.storeInBundle(bundle); bundle.put( PAGE, page() ); }
Random.IntRange( top + 1, bottom - 2 ))); } while (pos == level.entrance || level.findMob(level.entrance) != null); GuidePage p = new GuidePage(); p.page(Document.GUIDE_INTRO_PAGE); level.drop( p, pos ); Random.IntRange( top + 1, bottom - 2 ))); } while (pos == level.entrance || level.findMob(level.entrance) != null); GuidePage p = new GuidePage(); p.page(Document.GUIDE_SEARCH_PAGE); level.drop( p, pos );
@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 ); }
AlchemyPage p = new AlchemyPage(); p.page(missingPages.get(0)); int pos; do {
@Override public final boolean doPickUp(Hero hero) { GameScene.pickUpJournal(this, hero.pos); GameScene.flashJournal(); if (document() == Document.ALCHEMY_GUIDE){ WndJournal.last_index = 1; } else { WndJournal.last_index = 0; } document().addPage(page); Sample.INSTANCE.play( Assets.SND_ITEM ); hero.spendAndNext( TIME_TO_PICK_UP ); return true; }
Random.IntRange( top + 1, bottom - 2 ))); } while (pos == level.entrance || level.findMob(level.entrance) != null); GuidePage p = new GuidePage(); p.page(Document.GUIDE_INTRO_PAGE); level.drop( p, pos ); Random.IntRange( top + 1, bottom - 2 ))); } while (pos == level.entrance || level.findMob(level.entrance) != null); GuidePage p = new GuidePage(); p.page(Document.GUIDE_SEARCH_PAGE); level.drop( p, pos );
@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 ); }
AlchemyPage p = new AlchemyPage(); p.page(missingPages.get(0)); int pos; do {
@Override public void storeInBundle(Bundle bundle) { super.storeInBundle(bundle); bundle.put( PAGE, page() ); }
@Override public final boolean doPickUp(Hero hero) { GameScene.pickUpJournal(this, hero.pos); GameScene.flashJournal(); if (document() == Document.ALCHEMY_GUIDE){ WndJournal.last_index = 1; } else { WndJournal.last_index = 0; } document().addPage(page); Sample.INSTANCE.play( Assets.SND_ITEM ); hero.spendAndNext( TIME_TO_PICK_UP ); return true; }