Skip to content

ICardPart

namespace Griff.Modules.Cards;
public interface ICardPart

A component on a card’s entity (beside its Card) that hears what happens to the card and has a say in whether it can be played: an effect that deals damage as it’s played, a cost that has to be paid first. A script component can be one too. Every method has a default, so a part needs only what it uses.

public bool CanPlay(Card card, PlayZone zone)

False keeps the card from being played onto zone (it can’t be afforded yet). Asked before each play.

public void Discarded(Card card, Deck pile)

The card has been put on pile: discarded, or gathered back into its deck.

public void Drawn(Card card, Hand hand)

The card has been drawn into hand.

public void Played(Card card, PlayZone zone)

The card has been played onto zone.