Package com.amirhn.Game
Class Board
java.lang.Object
com.amirhn.Game.Board
The type Board.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copy board.boolean
Equals boolean.static Board
From fen board.Gets all pieces.Gets piece.boolean
isOccupied
(Location location) Is occupied boolean.boolean
isValidLocation
(Location location) Is valid location boolean.boolean
isValidPiece
(Piece piece) Is valid piece boolean.void
removePiece
(Piece piece) Remove piece.void
Sets piece.void
Sets 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.
-