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); }
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; } }
public void PlayWithoutCost(ICard card) { RunTriggeredAbilities(PlayerAction.Play, card.Name); Hand.Remove(card.Name); PlayedCards.Add(new PlayedCard(card)); }