Class PlayCardAction

java.lang.Object
net.demilich.metastone.game.actions.GameAction
net.demilich.metastone.game.actions.PlayCardAction
All Implemented Interfaces:
Serializable, Cloneable, Notification
Direct Known Subclasses:
PlayChooseOneCardAction, PlayHeroCardAction, PlayMinionCardAction, PlaySpellCardAction, PlayWeaponCardAction

public abstract class PlayCardAction extends GameAction
A play card action stores a card and an optional target.

When a Card is Card.play()'d, the action that is returned by that method doesn't have a GameAction.getTargetReference() even if it requires a target. ActionLogic.rollout(GameAction, GameContext, Player, Collection) will inspect the PlayCardAction, checking its GameAction.getTargetRequirement() to see if it's supposed to ask a target from the player.

This means that Card.play() action instance isn't yet a valid action that can be played, unless its CardDesc.getTargetSelection() is TargetSelection.NONE. If the target selection isn't NONE, the action should be rolled out into multiple actions, one corresponding to each valid target.

See Also: