java.lang.Object
it.polimi.ingsw.model.action.Action
it.polimi.ingsw.model.action.MoveAction
public class MoveAction extends Action
Describes and manages a movement action
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MoveAction(Worker targetWorker, Cell targetCell)
Default constructor -
Method Summary
Modifier and Type Method Description void
apply()
Forces an action to be appliedvoid
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
-
Constructor Details
-
MoveAction
Default constructor- Parameters:
targetWorker
- the worker to be movedtargetCell
- the cell to move the worker to
-
-
Method Details
-
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
-