Class Board

java.lang.Object
dev.laszlomocsy.tzaar.logic.board.Board

public class Board extends Object
The board of the game.

The board represents the game area with 60 spaces, where the Figures are placed.

  • Method Details

    • initEmpty

      public static Board initEmpty()
      Initializes a new empty board.
      Returns:
      a new empty board
    • initDefault

      public static Board initDefault()
      Initializes a new board with default placing.
      Returns:
      a new board with default placing
    • getStatus

      public BoardStatus getStatus()
      Retrieves the current status of the board.
      Returns:
      the current status of the board as a BoardStatus enum value
    • getFigures

      public List<Figure> getFigures()
      Retrieves the list of figures currently placed on the board.
      Returns:
      the list of figures currently placed on the board
    • getNextColor

      public FigureColor getNextColor()
      Retrieves the next color that can move.
      Returns:
      the next color that can move as a FigureColor enum value
    • getMoveCounter

      public int getMoveCounter()
      Retrieves the current move counter.
      Returns:
      the current move counter
    • startGame

      public void startGame()
      Starts the game.
    • placeFigure

      public void placeFigure(Figure figure)
      Places a new figure on the board.
      Parameters:
      figure - the figure to place on the board
    • moveFigure

      public BoardActionResult moveFigure(FigureLocation locationA, FigureLocation locationB)
      Moves a figure from one location to another on the board.
      Parameters:
      locationA - the location of the figure to move
      locationB - the location to move the figure to
      Returns:
      the result of the action as a BoardActionResult enum value
    • passMove

      public void passMove()
      Passes the move to the next color.