little polishing on QuestRewardCard classes

This commit is contained in:
Maxmtg
2013-03-16 22:25:34 +00:00
parent 74b2d09f41
commit 8dc331ed14
3 changed files with 5 additions and 10 deletions

View File

@@ -16,7 +16,7 @@ import forge.item.InventoryItem;
* TODO: Write javadoc for this type. * TODO: Write javadoc for this type.
* *
*/ */
public abstract class QuestRewardCard implements InventoryItem { public abstract class QuestRewardCard implements InventoryItem, IQuestRewardCard {
protected String buildDescription(final String [] input) { protected String buildDescription(final String [] input) {
final String defaultDescription = "a card"; final String defaultDescription = "a card";
@@ -130,5 +130,7 @@ public abstract class QuestRewardCard implements InventoryItem {
public String getImageFilename() { public String getImageFilename() {
return ""; return "";
} }
public abstract List<CardPrinted> getChoices();
} }

View File

@@ -90,6 +90,7 @@ public class QuestRewardCardChooser extends QuestRewardCard implements Inventory
* *
* @return a List<CardPrinted> or null if could not create a list. * @return a List<CardPrinted> or null if could not create a list.
*/ */
@Override
public final List<CardPrinted> getChoices() { public final List<CardPrinted> getChoices() {
if (type == poolType.playerCards) { if (type == poolType.playerCards) {
final ItemPool<CardPrinted> playerCards = Singletons.getModel().getQuest().getAssets().getCardPool(); final ItemPool<CardPrinted> playerCards = Singletons.getModel().getQuest().getAssets().getCardPool();

View File

@@ -39,15 +39,6 @@ public class QuestRewardCardFiltered extends QuestRewardCard implements IQuestRe
return description; return description;
} }
/**
* This class is a dynamic list of cards, hence no images.
*
* @return an empty string
*/
@Override
public String getImageFilename() {
return "";
}
/** /**
* The item type. * The item type.
@@ -64,6 +55,7 @@ public class QuestRewardCardFiltered extends QuestRewardCard implements IQuestRe
* *
* @return a List<CardPrinted> or null if could not create a list. * @return a List<CardPrinted> or null if could not create a list.
*/ */
@Override
public final List<CardPrinted> getChoices() { public final List<CardPrinted> getChoices() {
List<CardPrinted> cardChoices = new ArrayList<CardPrinted>(); List<CardPrinted> cardChoices = new ArrayList<CardPrinted>();
for (final CardPrinted card : Iterables.filter(CardDb.instance().getAllCards(), predicates)) { for (final CardPrinted card : Iterables.filter(CardDb.instance().getAllCards(), predicates)) {