From 4de0bdec642b8710639272525de92c41628c8d95 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Fri, 29 Jun 2012 10:03:20 +0400 Subject: [PATCH] Added builder method to cards --- Mage.Sets/src/mage/sets/Sets.java | 4 +++- .../sets/riseoftheeldrazi/AncientStirrings.java | 17 +++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/sets/Sets.java b/Mage.Sets/src/mage/sets/Sets.java index a6fb0acc559..8f306977778 100644 --- a/Mage.Sets/src/mage/sets/Sets.java +++ b/Mage.Sets/src/mage/sets/Sets.java @@ -298,7 +298,9 @@ public class Sets extends HashMap { public static Card createCard(Class clazz) { try { Constructor con = clazz.getConstructor(new Class[]{UUID.class}); - return (Card) con.newInstance(new Object[] {null}); + Card card = (Card) con.newInstance(new Object[] {null}); + card.build(); + return card; } catch (Exception ex) { logger.fatal("Error creating card:" + clazz.getName(), ex); return null; diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java index fc34a1b7deb..4204df0d2b0 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java @@ -28,7 +28,6 @@ package mage.sets.riseoftheeldrazi; -import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.dynamicvalue.common.StaticValue; @@ -36,30 +35,32 @@ import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; +import java.util.UUID; + /** - * * @author LevelX */ public class AncientStirrings extends CardImpl { private final static FilterCard filter = new FilterCard("colorless card"); + static { - filter.setColorless(true); - filter.setUseColorless(true); - } + filter.setColorless(true); + filter.setUseColorless(true); + } - public AncientStirrings (UUID ownerId) { + public AncientStirrings(UUID ownerId) { super(ownerId, 174, "Ancient Stirrings", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}"); this.expansionSetCode = "ROE"; - this.color.setGreen(true); + this.color.setGreen(true); // Look at the top five cards of your library. You may reveal a colorless card from among them and put it into your hand. // Then put the rest on the bottom of your library in any order. (Cards with no colored mana in their mana costs are colorless. Lands are also colorless.) this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(1), filter, false)); } - public AncientStirrings (final AncientStirrings card) { + public AncientStirrings(final AncientStirrings card) { super(card); }