Beispiel #1
0
 public static IEnumerable <Card> Of(this int count, CardType card)
 {
     for (int i = 0; i < count; i++)
     {
         yield return(card.Create());
     }
 }
 public PlayerGainedCardEvent(CardType card, IActionScope turnScope) : base(turnScope)
 {
     _card       = card;
     Description = String.Format("{0}: gained {1}",
                                 (turnScope == null || turnScope.Player == null)
                                 ? "none" : turnScope.Player.Name,
                                 card.Create().Name);
 }
Beispiel #3
0
        public void PerformBuy(CardType cardToPurchase)
        {
            if (Buys <= 0)
            {
                throw new OutOfBuysException();
            }

            Discard(Supply.AcquireCard(cardToPurchase, this));
            _turnState = _turnState.RegisterBuy(cardToPurchase.Create().BaseCost);
            _eventAggregator.Publish(new PlayerGainedCardEvent(cardToPurchase, this));
        }
 public void PerformBuy(CardType cardToPurchase)
 {
     PurchasedCards.Add(cardToPurchase.Create());
 }
Beispiel #5
0
 public override string ToString()
 {
     return(String.Format("Supply of {0} cards is empty", Type.Create()));
 }