public override void Play(Player player) { base.Play(player); List <Type> cardTypes = new List <Type>(); foreach (Card card in player.InPlay) { Type t = card.CardType; if (!cardTypes.Contains(t)) { cardTypes.Add(t); } } foreach (Card card in player.SetAside) { Type t = card.CardType; if (!cardTypes.Contains(t)) { cardTypes.Add(t); } } Currencies.Coin uniqueCardsInPlay = new Currencies.Coin(cardTypes.Count); SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= uniqueCardsInPlay); Choice choice = new Choice("Gain a card.", this, gainableSupplies, player, false); ChoiceResult result = player.MakeChoice(choice); if (result.Supply != null) { player.Gain(result.Supply); if ((result.Supply.Category & Cards.Category.Victory) == Cards.Category.Victory) { player.RetrieveCardFrom(DeckLocation.InPlay, this); player.Trash(this); } } }
public override void Play(Player player) { base.Play(player); List<Type> cardTypes = new List<Type>(); foreach (Card card in player.InPlay) { Type t = card.CardType; if (!cardTypes.Contains(t)) cardTypes.Add(t); } foreach (Card card in player.SetAside) { Type t = card.CardType; if (!cardTypes.Contains(t)) cardTypes.Add(t); } Currencies.Coin uniqueCardsInPlay = new Currencies.Coin(cardTypes.Count); SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= uniqueCardsInPlay); Choice choice = new Choice("Gain a card.", this, gainableSupplies, player, false); ChoiceResult result = player.MakeChoice(choice); if (result.Supply != null) { player.Gain(result.Supply); if ((result.Supply.Category & Cards.Category.Victory) == Cards.Category.Victory) { player.RetrieveCardFrom(DeckLocation.InPlay, this); player.Trash(this); } } }
public Cost(Currencies.Coin coinCost, Currencies.Potion potionCost, Boolean special, Boolean canOverpay) : this(coinCost, potionCost) { _Special = special; _CanOverpay = canOverpay; }
public Cost(Currencies.Coin coinCost, Currencies.Potion potionCost) : this(coinCost) { _Cost.Potion = potionCost; }
public Cost(Currencies.Coin coinCost) { _Cost.Coin = coinCost; }