Class GraveyardCardsSource

java.lang.Object
net.demilich.metastone.game.spells.desc.source.CardSource
net.demilich.metastone.game.spells.desc.source.GraveyardCardsSource
All Implemented Interfaces:
Serializable, HasDesc<CardSourceDesc>

public class GraveyardCardsSource extends CardSource
Returns a list of cards that are in the player's graveyard.

This includes the cards the user has played, discarded or roasted. To differentiate between them, use an AttributeFilter for the attributes Attribute.PLAYED_FROM_HAND_OR_DECK, Attribute.DISCARDED or Attribute.ROASTED.

See Also:
  • Constructor Details

    • GraveyardCardsSource

      public GraveyardCardsSource(CardSourceDesc desc)
  • Method Details

    • match

      protected CardList match(GameContext context, Entity source, Player player)
      Description copied from class: CardSource
      Overridden by card source implementations to return a list of cards that usually get filtered in an EntityFilter.

      See the implementations for examples of how, e.g. the graveyard is turned into a CardList instance by iterating through all the actors in the graveyard and retrieving their Entity.getSourceCard().

      Specified by:
      match in class CardSource
      Parameters:
      context - The game context
      source - The entity that is the origin of this matching operation
      player - The casting player
      Returns:
      A list of cards pre-filter.