Class Board
java.lang.Object
dev.laszlomocsy.tzaar.logic.board.Board
The board of the game.
The board represents the game area with 60 spaces, where the Figure
s are placed.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the list of figures currently placed on the board.int
Retrieves the current move counter.Retrieves the next color that can move.Retrieves the current status of the board.static Board
Initializes a new board with default placing.static Board
Initializes a new empty board.moveFigure
(FigureLocation locationA, FigureLocation locationB) Moves a figure from one location to another on the board.void
passMove()
Passes the move to the next color.void
placeFigure
(Figure figure) Places a new figure on the board.void
Starts the game.
-
Method Details
-
initEmpty
Initializes a new empty board.- Returns:
- a new empty board
-
initDefault
Initializes a new board with default placing.- Returns:
- a new board with default placing
-
getStatus
Retrieves the current status of the board.- Returns:
- the current status of the board as a
BoardStatus
enum value
-
getFigures
Retrieves the list of figures currently placed on the board.- Returns:
- the list of figures currently placed on the board
-
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
Places a new figure on the board.- Parameters:
figure
- the figure to place on the board
-
moveFigure
Moves a figure from one location to another on the board.- Parameters:
locationA
- the location of the figure to movelocationB
- 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.
-