Class GraveyardActorsSource

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

public class GraveyardActorsSource extends CardSource implements HasCardCreationSideEffects
Returns the source cards of the actors in the graveyard, including the minions, weapons and heroes. The Attribute.DIED_ON_TURN attribute is copied to the card, even though it ordinarily does not belong on cards.

Does not include cards that were removed peacefully according to Entity.isRemovedPeacefully(), even though those actors are in the graveyard too.

See Also:
  • Constructor Details

    • GraveyardActorsSource

      public GraveyardActorsSource(CardSourceDesc desc)
  • Method Details

    • create

      public static CardSource create()
    • create

      public static CardSource create(TargetPlayer targetPlayer)
    • 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.