Class TopCardsOfDeckSource

All Implemented Interfaces:
Serializable, HasDesc<CardSourceDesc>
Direct Known Subclasses:
TopThreeCardsOfDeckSource

public class TopCardsOfDeckSource extends DeckSource
Returns the top N cards of the deck, where N is defined by the CardSourceArg.VALUE arg
See Also:
  • Constructor Details

    • TopCardsOfDeckSource

      public TopCardsOfDeckSource(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().

      Overrides:
      match in class DeckSource
      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.
    • howMany

      protected int howMany(GameContext context, Entity source, Player player)