java.lang.Object
it.polimi.ingsw.model.rules.RuleSetBase
it.polimi.ingsw.model.godCardsEffects.buildingEffects.BuildingStrategy
it.polimi.ingsw.model.godCardsEffects.buildingEffects.BuildDome
- All Implemented Interfaces:
RuleSetStrategy
public class BuildDome extends BuildingStrategy
-
Field Summary
Fields inherited from class it.polimi.ingsw.model.rules.RuleSetBase
buildsAvailable, game, hasMovedUp, movedWorker, movesAvailable, movesUpAvailable, startingCell
-
Constructor Summary
Constructors Constructor Description BuildDome()
-
Method Summary
Modifier and Type Method Description RuleSetStrategy
cloneStrategy(Game game)
Creates a clone of this objectjava.util.List<Block>
getBlocks(Cell selectedCell)
Provides the possible blocks buildable on a given cellboolean
isBuildActionValid(BuildAction action)
Determines if a buildAction is legal and applies itMethods inherited from class it.polimi.ingsw.model.rules.RuleSetBase
addBuildableCells, addWalkableCells, canBuild, canEndTurn, canEndTurnAutomatically, checkLoseCondition, checkLoseCondition, checkLoseCondition, checkWinCondition, doEffect, getBuildableCells, getBuildsAvailable, getMovedWorker, getMovesAvailable, getMovesUpAvailable, getPossibleActions, getWalkableCells, hasMovedUp, initialize, isCorrectBlock, isCorrectDistance, isInsideBuildableCells, isInsideWalkableCells, isMoveActionValid, setGame, setMovesUpAvailable
-
Constructor Details
-
BuildDome
public BuildDome()
-
-
Method Details
-
isBuildActionValid
Determines if a buildAction is legal and applies itg this ruleSet, a build action is considered valid if the following conditions are all true:
- a worker has already been moved
- the worker to perform the action is the same which has been moved
- the cell to build on is a buildable cell (see RuleSetBase.getBuildableCells(Worker)) for the worker
- Specified by:
isBuildActionValid
in interfaceRuleSetStrategy
- Overrides:
isBuildActionValid
in classRuleSetBase
- Parameters:
action
- the build action to validate- Returns:
- true if the action has been applied, false otherwise
-
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
-
getBlocks
Provides the possible blocks buildable on a given cellg this ruleSet, a worker can build
- a block which level is immediately taller than the cell to build on
- a dome
- Specified by:
getBlocks
in interfaceRuleSetStrategy
- Overrides:
getBlocks
in classRuleSetBase
- Parameters:
selectedCell
- the cell to get the buildable blocks for- Returns:
- a list of blocks that can be built on the given cell
-