java.lang.Object
it.polimi.ingsw.model.action.Action
it.polimi.ingsw.model.action.BuildAction
public class BuildAction extends Action
Describes and manages a build action
-
Field Summary
Fields Modifier and Type Field Description protected Block
targetBlock
-
Constructor Summary
Constructors Constructor Description BuildAction(Worker targetWorker, Cell targetCell, Block targetBlock)
Default constructor -
Method Summary
Modifier and Type Method Description void
apply()
Forces an action to be appliedBlock
getTargetBlock()
targetBlock gettervoid
getValidation(Game game)
Checks if the action can be performed, based on the game statusMethods inherited from class it.polimi.ingsw.model.action.Action
getStartingCell, getTargetCell, getTargetWorker
-
Field Details
-
Constructor Details
-
BuildAction
Default constructor- Parameters:
targetWorker
- the worker performing the actiontargetCell
- the cell to build ontargetBlock
- the block to build on the target cell
-
-
Method Details
-
getTargetBlock
targetBlock getter- Returns:
- the block to build
-
apply
public void apply()Forces an action to be applied -
getValidation
Checks if the action can be performed, based on the game status- Specified by:
getValidation
in classAction
- Parameters:
game
- the game object which validates the action- Throws:
IllegalActionException
- if the action cannot be performed
-