added Sealed tournaments

This commit is contained in:
BetaSteward 2011-02-10 22:00:47 -05:00
parent 44aefaf47a
commit f7ffbb4773
51 changed files with 652 additions and 143 deletions

View file

@ -36,6 +36,7 @@ import mage.abilities.ActivatedAbility;
import mage.abilities.TriggeredAbilities;
import mage.cards.Card;
import mage.cards.Cards;
import mage.cards.decks.Deck;
/**
*
@ -44,7 +45,7 @@ import mage.cards.Cards;
public class PlayerQueryEvent extends EventObject implements ExternalEvent, Serializable {
public enum QueryType {
ASK, CHOOSE, CHOOSE_ABILITY, PICK_TARGET, PICK_ABILITY, SELECT, PLAY_MANA, PLAY_X_MANA, AMOUNT, LOOK, PICK_CARD
ASK, CHOOSE, CHOOSE_ABILITY, PICK_TARGET, PICK_ABILITY, SELECT, PLAY_MANA, PLAY_X_MANA, AMOUNT, LOOK, PICK_CARD, CONSTRUCT
}
private String message;
@ -58,6 +59,7 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri
private boolean required;
private int min;
private int max;
private Deck deck;
private Map<String, Serializable> options;
private PlayerQueryEvent(UUID playerId, String message, Collection<? extends Ability> abilities, Set<String> choices, Set<UUID> targets, Cards cards, QueryType queryType, int min, int max, boolean required, Map<String, Serializable> options) {
@ -88,6 +90,15 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri
this.max = time;
}
private PlayerQueryEvent(UUID playerId, String message, QueryType queryType, Deck deck, int time) {
super(playerId);
this.queryType = queryType;
this.message = message;
this.playerId = playerId;
this.deck = deck;
this.max = time;
}
public static PlayerQueryEvent askEvent(UUID playerId, String message) {
return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false);
}
@ -139,6 +150,11 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri
return new PlayerQueryEvent(playerId, message, booster, QueryType.PICK_CARD, time);
}
public static PlayerQueryEvent construct(UUID playerId, String message, Deck deck, int time) {
return new PlayerQueryEvent(playerId, message, QueryType.CONSTRUCT, deck, time);
}
public String getMessage() {
return message;
}
@ -183,6 +199,10 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri
return max;
}
public Deck getDeck() {
return deck;
}
public Map<String, Serializable> getOptions() {
return options;
}