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 SummaryFields Modifier and Type Field Description protected BlocktargetBlock
- 
Constructor SummaryConstructors Constructor Description BuildAction(Worker targetWorker, Cell targetCell, Block targetBlock)Default constructor
- 
Method SummaryModifier and Type Method Description voidapply()Forces an action to be appliedBlockgetTargetBlock()targetBlock gettervoidgetValidation(Game game)Checks if the action can be performed, based on the game statusMethods inherited from class it.polimi.ingsw.model.action.ActiongetStartingCell, getTargetCell, getTargetWorker
- 
Field Details
- 
Constructor Details- 
BuildActionDefault constructor- Parameters:
- targetWorker- the worker performing the action
- targetCell- the cell to build on
- targetBlock- the block to build on the target cell
 
 
- 
- 
Method Details- 
getTargetBlocktargetBlock getter- Returns:
- the block to build
 
- 
applypublic void apply()Forces an action to be applied
- 
getValidationChecks if the action can be performed, based on the game status- Specified by:
- getValidationin class- Action
- Parameters:
- game- the game object which validates the action
- Throws:
- IllegalActionException- if the action cannot be performed
 
 
-