示例#1
0
        public void Gain(ICard card)
        {
            if (card is IOnGainOverride o)
            {
                o.OnGain(this, card.Name);
            }
            else
            {
                if (card is IOnGainAbilityHolder ah)
                {
                    ah.ResolveOnGainAbilities(this);
                }

                DiscardPile.Add(card.Name);
            }

            //check on gain triggers
            RunTriggeredAbilities(PlayerAction.Gain, card.Name);
        }
示例#2
0
        public void Play(ICard card)
        {
            RunTriggeredAbilities(PlayerAction.Play, card.Name);
            Hand.Remove(card.Name);
            PlayedCards.Add(new PlayedCard(card));

            switch (card)
            {
            case IAction a:
                NumberOfActions--;
                break;

            case ITreasure t:

                if (t is ITreasureAbilityHolder h)
                {
                    h.ResolveTreasureAbilities(this);
                }

                MoneyPlayed += t.Value;
                break;
            }
        }
示例#3
0
 public void PlayWithoutCost(ICard card)
 {
     RunTriggeredAbilities(PlayerAction.Play, card.Name);
     Hand.Remove(card.Name);
     PlayedCards.Add(new PlayedCard(card));
 }