mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
CardPool is now parametrized, preparing to hold boosters and packaged decks in quest inventory
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user