CardPool is now parametrized, preparing to hold boosters and packaged decks in quest inventory

This commit is contained in:
Maxmtg
2011-09-14 05:34:33 +00:00
parent 4062f6c279
commit d3a51720a8
46 changed files with 597 additions and 548 deletions

View File

@@ -43,7 +43,7 @@ public class BoosterDraftAITest {
public void runTest(BoosterDraftAI ai) {
ReadDraftBoosterPack booster = new ReadDraftBoosterPack();
for (int outer = 0; outer < 1; outer++) {
CardPool allBooster = new CardPool();
CardPool<CardPrinted> allBooster = new CardPool<CardPrinted>();
for (int i = 0; i < 21; i++)
allBooster.addAll(booster.getBoosterPack());

View File

@@ -32,7 +32,7 @@ public class BoosterDraftTest implements BoosterDraft {
*
* @return a {@link forge.CardList} object.
*/
public CardPoolView nextChoice() {
public CardPoolView<CardPrinted> nextChoice() {
n--;
ReadDraftBoosterPack pack = new ReadDraftBoosterPack();
return pack.getBoosterPack();

View File

@@ -1,10 +1,8 @@
package forge;
import net.slightlymagic.maxmtg.Predicate;
import org.testng.annotations.Test;
import forge.card.CardRules;
import forge.card.CardPrinted;
import forge.card.CardPoolView;
import forge.game.limited.BoosterDraft_1;
@@ -23,9 +21,9 @@ public class BoosterDraft_1Test {
public void BoosterDraft_1Test1() throws Exception {
BoosterDraft_1 draft = new BoosterDraft_1();
while (draft.hasNextChoice()) {
CardPoolView list = draft.nextChoice();
CardPoolView<CardPrinted> list = draft.nextChoice();
System.out.println(list.countAll());
draft.setChoice(Predicate.getTrue(CardRules.class).first(list, CardPoolView.fnToCard, CardPoolView.fnToPrinted));
draft.setChoice(list.toFlatList().get(0));
}
}
}