Class ManaCostFilter

java.lang.Object
net.demilich.metastone.game.spells.desc.filter.EntityFilter
net.demilich.metastone.game.spells.desc.filter.ManaCostFilter
All Implemented Interfaces:
java.io.Serializable, HasDesc<EntityFilterDesc>
Direct Known Subclasses:
EvenCostFilter, OddCostFilter

public class ManaCostFilter
extends EntityFilter
Gets the target's in-hand mana cost or its base mana cost, and compares it using EntityFilterArg.OPERATION to the value EntityFilterArg.VALUE.

The value is evaluated with a null target.

See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • create

      public static ManaCostFilter create​(int manaCost, ComparisonOperation operation)
    • test

      protected boolean test​(GameContext context, Player player, Entity entity, Entity host)
      Description copied from class: EntityFilter
      The subclasses of this class implement this method to actually perform the logic of the filtering. Observe that results from filtering other entities are not available here; this function is stateless in the sense that an earlier acceptance or rejection of an entity cannot influence the acceptance or rejection of a current entity.
      Specified by:
      test in class EntityFilter
      Returns:
    • getManaCost

      @Suspendable protected int getManaCost​(GameContext context, Player player, Entity entity)