java.lang.Object
All Implemented Interfaces:
RuleSetStrategy

public class BuildDome
extends BuildingStrategy
  • Constructor Details

  • Method Details

    • isBuildActionValid

      public boolean isBuildActionValid​(BuildAction action)
      Determines if a buildAction is legal and applies it

      g 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 interface RuleSetStrategy
      Overrides:
      isBuildActionValid in class RuleSetBase
      Parameters:
      action - the build action to validate
      Returns:
      true if the action has been applied, false otherwise
    • cloneStrategy

      public RuleSetStrategy cloneStrategy​(Game game)
      Creates a clone of this object
      Specified by:
      cloneStrategy in interface RuleSetStrategy
      Overrides:
      cloneStrategy in class RuleSetBase
      Parameters:
      game - the current game
      Returns:
      a clone of this object
    • getBlocks

      public java.util.List<Block> getBlocks​(Cell selectedCell)
      Provides the possible blocks buildable on a given cell

      g this ruleSet, a worker can build

      • a block which level is immediately taller than the cell to build on
      • a dome
      Note that the standard rules about building on domes still apply
      Specified by:
      getBlocks in interface RuleSetStrategy
      Overrides:
      getBlocks in class RuleSetBase
      Parameters:
      selectedCell - the cell to get the buildable blocks for
      Returns:
      a list of blocks that can be built on the given cell