Search in sources :

Example 1 with CardSetInfo

use of mage.cards.CardSetInfo in project mage by magefree.

the class DeckBuilderTest method testAllArtifacts.

@Test
public void testAllArtifacts() {
    final List<Card> spellCardPool = new ArrayList<>();
    final UUID owner = UUID.randomUUID();
    final List<ColoredManaSymbol> allowedColors = new ArrayList<>(Arrays.asList(ColoredManaSymbol.U));
    final List<String> setsToUse = new ArrayList<>();
    final List<Card> landCardPool = null;
    final RateCallback rateCallback = new RateCallback() {

        @Override
        public int rateCard(Card card) {
            return 6;
        }

        @Override
        public Card getBestBasicLand(ColoredManaSymbol color, List<String> setsToUse) {
            Assert.assertNotNull(color);
            return new Island(owner, new CardSetInfo("Island", "MRD", "999", Rarity.LAND));
        }
    };
    for (int i = 0; i < 24; i++) {
        Card c = new RandomArtifactCreature(owner, i, "Random Artifact " + i);
        spellCardPool.add(c);
    }
    DeckBuilder.buildDeck(spellCardPool, allowedColors, setsToUse, landCardPool, 40, rateCallback);
}
Also used : CardSetInfo(mage.cards.CardSetInfo) ArrayList(java.util.ArrayList) RateCallback(mage.interfaces.rate.RateCallback) Island(mage.cards.basiclands.Island) Card(mage.cards.Card) ColoredManaSymbol(mage.constants.ColoredManaSymbol) ArrayList(java.util.ArrayList) List(java.util.List) UUID(java.util.UUID) Test(org.junit.Test)

Example 2 with CardSetInfo

use of mage.cards.CardSetInfo in project mage by magefree.

the class CustomTestCard method addCustomCardWithAbility.

protected void addCustomCardWithAbility(String customName, TestPlayer controllerPlayer, Ability ability, SpellAbility spellAbility, CardType cardType, String spellCost, Zone putAtZone, SubType... additionalSubTypes) {
    CustomTestCard.clearCustomAbilities(customName);
    CustomTestCard.addCustomAbility(customName, spellAbility, ability);
    CustomTestCard.clearAdditionalSubtypes(customName);
    CustomTestCard.addAdditionalSubtypes(customName, additionalSubTypes);
    CardSetInfo testSet = new CardSetInfo(customName, "custom", "123", Rarity.COMMON);
    Card newCard = new CustomTestCard(controllerPlayer.getId(), testSet, cardType, spellCost);
    Card permCard = CardUtil.getDefaultCardSideForBattlefield(currentGame, newCard);
    PermanentCard permanent = new PermanentCard(permCard, controllerPlayer.getId(), currentGame);
    switch(putAtZone) {
        case BATTLEFIELD:
            getBattlefieldCards(controllerPlayer).add(permanent);
            break;
        case GRAVEYARD:
            getGraveCards(controllerPlayer).add(newCard);
            break;
        case HAND:
            getHandCards(controllerPlayer).add(newCard);
            break;
        case LIBRARY:
            getLibraryCards(controllerPlayer).add(newCard);
            break;
        case COMMAND:
            getCommandCards(controllerPlayer).add(newCard);
            break;
        default:
            Assert.fail("Unsupported zone: " + putAtZone);
    }
}
Also used : CardSetInfo(mage.cards.CardSetInfo) Card(mage.cards.Card) PermanentCard(mage.game.permanent.PermanentCard) PermanentCard(mage.game.permanent.PermanentCard)

Example 3 with CardSetInfo

use of mage.cards.CardSetInfo in project mage by magefree.

the class MulliganTestBase method generateDeck.

public static Deck generateDeck(UUID playerId, int count) {
    Deck deck = new Deck();
    Stream.generate(() -> new Forest(playerId, new CardSetInfo("Forest", "TEST", "1", LAND))).limit(count).forEach(deck.getCards()::add);
    return deck;
}
Also used : CardSetInfo(mage.cards.CardSetInfo) Deck(mage.cards.decks.Deck) Forest(mage.cards.basiclands.Forest)

Aggregations

CardSetInfo (mage.cards.CardSetInfo)3 Card (mage.cards.Card)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 UUID (java.util.UUID)1 Forest (mage.cards.basiclands.Forest)1 Island (mage.cards.basiclands.Island)1 Deck (mage.cards.decks.Deck)1 ColoredManaSymbol (mage.constants.ColoredManaSymbol)1 PermanentCard (mage.game.permanent.PermanentCard)1 RateCallback (mage.interfaces.rate.RateCallback)1 Test (org.junit.Test)1