Package com.amirhn.Game
Class Board
java.lang.Object
com.amirhn.Game.Board
The type Board.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Copy board.booleanEquals boolean.static BoardFrom fen board.Gets all pieces.Gets piece.booleanisOccupied(Location location) Is occupied boolean.booleanisValidLocation(Location location) Is valid location boolean.booleanisValidPiece(Piece piece) Is valid piece boolean.voidremovePiece(Piece piece) Remove piece.voidSets piece.voidSets fen.toString()To string string.
-
Field Details
-
rows
public final int rowsThe Rows. -
columns
public final int columnsThe Rows. -
pieceByLocation
The Piece by location.
-
-
Constructor Details
-
Board
public Board(int rows, int columns) Instantiates a new Board.- Parameters:
rows- the rowscolumns- the columns
-
-
Method Details
-
fromFEN
From fen board.- Parameters:
fen- the fen- Returns:
- the board
-
setupFEN
Sets fen.- Parameters:
fen- the fen
-
isValidLocation
Is valid location boolean.- Parameters:
location- the location- Returns:
- the boolean
-
isOccupied
Is occupied boolean.- Parameters:
location- the location- Returns:
- the boolean
-
getPiece
Gets piece.- Parameters:
location- the location- Returns:
- the piece
-
setPiece
Sets piece.- Parameters:
piece- the piece
-
removePiece
Remove piece.- Parameters:
piece- the piece
-
getAllPieces
Gets all pieces.- Returns:
- the all pieces
-
isValidPiece
Is valid piece boolean.- Parameters:
piece- the piece- Returns:
- the boolean
-
toString
To string string. -
copy
Copy board.- Returns:
- the board
-
equals
Equals boolean.
-