Added builder method to cards

This commit is contained in:
magenoxx 2012-06-29 10:03:20 +04:00
parent 533cc69101
commit 4de0bdec64
2 changed files with 12 additions and 9 deletions

View file

@ -298,7 +298,9 @@ public class Sets extends HashMap<String, ExpansionSet> {
public static Card createCard(Class clazz) { public static Card createCard(Class clazz) {
try { try {
Constructor<?> con = clazz.getConstructor(new Class[]{UUID.class}); 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) { } catch (Exception ex) {
logger.fatal("Error creating card:" + clazz.getName(), ex); logger.fatal("Error creating card:" + clazz.getName(), ex);
return null; return null;

View file

@ -28,7 +28,6 @@
package mage.sets.riseoftheeldrazi; package mage.sets.riseoftheeldrazi;
import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity; import mage.Constants.Rarity;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
@ -36,13 +35,15 @@ import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import java.util.UUID;
/** /**
*
* @author LevelX * @author LevelX
*/ */
public class AncientStirrings extends CardImpl<AncientStirrings> { public class AncientStirrings extends CardImpl<AncientStirrings> {
private final static FilterCard filter = new FilterCard("colorless card"); private final static FilterCard filter = new FilterCard("colorless card");
static { static {
filter.setColorless(true); filter.setColorless(true);
filter.setUseColorless(true); filter.setUseColorless(true);