ICardPart
namespace Griff.Modules.Cards;
public interface ICardPartA 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.
Methods
Section titled “Methods”CanPlay
Section titled “CanPlay”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.
Discarded
Section titled “Discarded”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.
Played
Section titled “Played”public void Played(Card card, PlayZone zone)The card has been played onto zone.