Skip to content
Jerome Leclanche edited this page Jul 13, 2015 · 1 revision

Selectors

Selectors filter upon a list of entities from the point of view of an entity (the source).

The basic Selector class takes an Enum as argument and will test against the test(entity, source) method of that enum. The method must return True if the test is successful, False if not.

Currently, the supported enums are CardType, Race, Zone, or Affiliation.

In addition to the base selector, there are some special selectors to make it easier to target entities in more elaborate ways:

  • SelfSelector will always find the source.
  • TargetSelector will always find the target of the source.
  • AdjacentSelector(selector) will always find the minions adjacent to the entities selected by the selector. The selector argument itself must never return any non-minions.
  • RandomSelector(selector) will always pick a random entity from the pool available from the selector argument. RandomSelector instances can be multiplied (eg. RandomSelector(selector) * 2) to pick more than 1 random target.