Module AM37
Class CannotMoveUp
java.lang.Object
it.polimi.ingsw.model.rules.RuleSetBase
it.polimi.ingsw.model.godCardsEffects.affectOpponentTurnEffects.AffectOpponentTurnStrategy
it.polimi.ingsw.model.godCardsEffects.affectOpponentTurnEffects.CannotMoveUp
- All Implemented Interfaces:
RuleSetStrategy
public class CannotMoveUp extends AffectOpponentTurnStrategy
If a worker of a player using this effects moves on an higher level, all the other players cannot move on an higher
level during their next turn. If an opponent can only move up and this effect is active, it automatically loses.
-
Field Summary
Fields inherited from class it.polimi.ingsw.model.rules.RuleSetBase
buildsAvailable, game, hasMovedUp, movedWorker, movesAvailable, movesUpAvailable, startingCell
-
Constructor Summary
Constructors Constructor Description CannotMoveUp()
Default constructor -
Method Summary
Modifier and Type Method Description RuleSetStrategy
cloneStrategy(Game game)
Creates a clone of this objectvoid
doEffect()
Applies the end turn effectMethods inherited from class it.polimi.ingsw.model.rules.RuleSetBase
addBuildableCells, addWalkableCells, canBuild, canEndTurn, canEndTurnAutomatically, checkLoseCondition, checkLoseCondition, checkLoseCondition, checkWinCondition, getBlocks, getBuildableCells, getBuildsAvailable, getMovedWorker, getMovesAvailable, getMovesUpAvailable, getPossibleActions, getWalkableCells, hasMovedUp, initialize, isBuildActionValid, isCorrectBlock, isCorrectDistance, isInsideBuildableCells, isInsideWalkableCells, isMoveActionValid, setGame, setMovesUpAvailable
-
Constructor Details
-
CannotMoveUp
public CannotMoveUp()Default constructor- See Also:
RuleSetBase.initialize()
-
-
Method Details
-
doEffect
public void doEffect()Applies the end turn effectUsing this ruleSet, the end turn effects reset the attributes changed during the turn and, if a worker has moved up during the turn, all of the other workers cannot move on a taller building during their next turn
- Specified by:
doEffect
in interfaceRuleSetStrategy
- Overrides:
doEffect
in classRuleSetBase
-
cloneStrategy
Creates a clone of this object- Specified by:
cloneStrategy
in interfaceRuleSetStrategy
- Overrides:
cloneStrategy
in classRuleSetBase
- Parameters:
game
- the current game- Returns:
- a clone of this object
-