java.lang.Object
cz.cvut.fel.pjv.model.Board
- All Implemented Interfaces:
java.io.Serializable
public class Board
extends java.lang.Object
implements java.io.Serializable
Class representations Chessboard and support methods
- See Also:
- Serialized Form
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description SpotgetBox(int x, int y)Return spot on chessboard if exist.Spot[][]getBoxes()booleanisActiveCheckingIsKingInDanger()booleanisBoardEqual(Board board)Equal pieces in 2 chessboards.voidprintBoard()Print the chessboardvoidsetActiveCheckingIsKingInDanger(boolean activeCheckingIsKingInDanger)voidsetBoxes(Spot[][] boxes)voidtestBishopMoves()voidtestKingInDanger()voidtestRepetition()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Board
public Board()For create new chessboard use newBoard function -
Board
public Board(boolean testBishop) -
Board
Create new chessboard.- Parameters:
board-
-
-
Method Details
-
setActiveCheckingIsKingInDanger
public void setActiveCheckingIsKingInDanger(boolean activeCheckingIsKingInDanger) -
isActiveCheckingIsKingInDanger
public boolean isActiveCheckingIsKingInDanger() -
getBoxes
-
setBoxes
-
getBox
Return spot on chessboard if exist.- Parameters:
x- coordinatey- coordinate- Returns:
- Throws:
java.lang.Exception
-
isBoardEqual
Equal pieces in 2 chessboards.- Parameters:
board-- Returns:
- Throws:
java.lang.Exception
-
testRepetition
public void testRepetition() -
testKingInDanger
public void testKingInDanger() -
testBishopMoves
public void testBishopMoves() -
printBoard
public void printBoard()Print the chessboard
-