Class WorkerBuildMap

java.lang.Object
it.polimi.ingsw.server.model.WorkerMap
it.polimi.ingsw.server.model.WorkerBuildMap

public class WorkerBuildMap
extends WorkerMap
Represents the positions adjacent to the worker, in which he may or may not build, depending on the boolean value of the cell.
  • Constructor Details

  • Method Details

    • cannotBuildInOccupiedCell

      public void cannotBuildInOccupiedCell()
      Forbids worker to build in a cell occupied by a dome or another worker.
    • cannotBuildUnderneath

      public void cannotBuildUnderneath()
      Forbids worker to build underneath himself.
    • canBuildUnderneath

      public void canBuildUnderneath()
      Allows worker to build underneath himself.
    • isAllowedToBuildBoard

      public boolean isAllowedToBuildBoard​(int i, int j)
      Finds out if worker is allowed to build in a given cell of the board.
      Parameters:
      i - Board coordinate X.
      j - Board coordinate Y.
      Returns:
      True if it can build in cell, false otherwise.
    • anyAvailableBuildPosition

      public boolean anyAvailableBuildPosition()
      Checks if the worker can build.
      Returns:
      Returns true if there is a cell the worker can build in, false otherwise.
    • cannotBuildInPerimeter

      public void cannotBuildInPerimeter()
      Forbids the worker to build in a perimeter cell of the board.