Class GraveyardCardAndActorSourceCardSource

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

public class GraveyardCardAndActorSourceCardSource extends CardSource
Returns a list of cards in the player's graveyard, including minion's cards.
See Also:
  • Constructor Details

    • GraveyardCardAndActorSourceCardSource

      public GraveyardCardAndActorSourceCardSource(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.
    • graveyardCards

      @NotNull public static @NotNull CardList graveyardCards(GameContext context, Player player)
      Gets the cards that properly belong in the player's Spellsource.ZonesMessage.Zones.GRAVEYARD, meaning they were played by the player or they are the card representing a token or minion that died (not peacefully) on the battlefield.

      This means when a minion is played, this method will not return the card from which the minion was played until the minion is destroyed. However, there is still a card with the minion's card ID in the graveyard as soon as it is played. This method can be used to tell the difference between a card corresponding to a played minion (which is always in the graveyard) versus a card of a minion that has died.

      Parameters:
      context -
      player -
      Returns: