Class ActionLogic
java.lang.Object
net.demilich.metastone.game.logic.ActionLogic
- All Implemented Interfaces:
Serializable
This class turns game actions into a list of possible actions for the player.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetValidActions(GameContext context, Player player) Iterates through the cards and minions belonging to the player, and determines what actions are available.voidrollout(GameAction action, GameContext context, Player player, Collection<GameAction> actions) Rolls out actions.
-
Constructor Details
-
ActionLogic
public ActionLogic()
-
-
Method Details
-
getValidActions
Iterates through the cards and minions belonging to the player, and determines what actions are available. This also takes into account the available mana, game rules, etc.- Parameters:
context-player-- Returns:
-
rollout
public void rollout(GameAction action, GameContext context, Player player, Collection<GameAction> actions) Rolls out actions. For actions that havetargetRequirementvalues that aren'tTargetSelection.NONE, returning new actions whoseGameAction.getTargetReference()is a valid target.- Parameters:
action-context-player-actions-
-