public class Board
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static int |
BLACK |
|
static int |
BOARD_SIZE |
|
static int |
RED |
Constructor | Description |
---|---|
Board(User redUser,
User blackUser) |
Create the board and initialize the array
|
Modifier and Type | Method | Description |
---|---|---|
java.util.List<Move> |
checkMoves(Coordinate coordinate) |
Get all valid moves for a position
|
User |
checkWinCon() |
Check to see if there is a winner
|
User |
getBlackUser() |
Get the black user
|
Piece[][] |
getCurrentBoardState() |
Get the current array representing the board state
|
User |
getCurrentUser() |
Get the user whose turn it is
|
User |
getRedUser() |
Get the red user
|
boolean |
movePiece(Move move) |
Move a piece according to the specified move
|
Piece |
selectPiece(Coordinate coordinate) |
Get the piece at the given board coordinate
|
User |
switchCurrentUser() |
Switch the current user to the opposing user
|
public static final int BOARD_SIZE
public static final int RED
public static final int BLACK
public boolean movePiece(Move move)
move
- The move containing the coordinates to move the piecepublic Piece selectPiece(Coordinate coordinate)
coordinate
- The (x, y) coordinate of the board to get a piece frompublic java.util.List<Move> checkMoves(Coordinate coordinate)
coordinate
- The coordinate of the piece to check moves forpublic User getBlackUser()
public User getRedUser()
public User getCurrentUser()
public User switchCurrentUser()
public Piece[][] getCurrentBoardState()
public User checkWinCon()