/** * awardSpecialReward. This builds the card reward based on the string data. * * @param message String, reward text to be displayed, if any */ private void awardSpecialReward(String message) { final List<InventoryItem> itemsWon = qEvent.getCardRewardList(); if (itemsWon == null || itemsWon.isEmpty()) { return; } final List<PaperCard> cardsWon = new ArrayList<>(); for (final InventoryItem ii : itemsWon) { if (ii instanceof PaperCard) { cardsWon.add((PaperCard) ii); } else if (ii instanceof TournamentPack || ii instanceof BoosterPack) { final List<PaperCard> boosterCards = new ArrayList<>(); SealedProduct booster; if (ii instanceof BoosterPack) { booster = (BoosterPack) ((BoosterPack) ii).clone(); boosterCards.addAll(booster.getCards()); } else { booster = (TournamentPack) ((TournamentPack) ii).clone(); boosterCards.addAll(booster.getCards()); } if (!boosterCards.isEmpty()) { qData.getCards().addAllCards(boosterCards); view.showCards("Extra " + ii.getName() + "!", boosterCards); } } else if (ii instanceof IQuestRewardCard) { final List<PaperCard> cardChoices = ((IQuestRewardCard) ii).getChoices(); final PaperCard chosenCard = (null == cardChoices ? null : SGuiChoose.one("Choose " + ii.getName(), cardChoices)); if (null != chosenCard) { cardsWon.add(chosenCard); } } } if (!cardsWon.isEmpty()) { if (message == null) { message = "Cards Won"; } view.showCards(message, cardsWon); qData.getCards().addAllCards(cardsWon); } }