53 lines
1.1 KiB
Java
53 lines
1.1 KiB
Java
public class Player {
|
|
|
|
private Chessboard chessboard;
|
|
|
|
private PieceColor color;
|
|
|
|
private StartPosition startPosition;
|
|
|
|
private King king;
|
|
|
|
private boolean[][] coverageArea;
|
|
|
|
public Player(Chessboard chessboard, StartPosition startPosition, PieceColor color) {
|
|
this.chessboard = chessboard;
|
|
this.color = color;
|
|
this.startPosition = startPosition;
|
|
this.coverageArea = new boolean[chessboard.SQUARE_COUNT][chessboard.SQUARE_COUNT];
|
|
}
|
|
|
|
public boolean inCheck() {
|
|
return king.isEndangered();
|
|
}
|
|
|
|
public Chessboard getChessboard() {
|
|
return chessboard;
|
|
}
|
|
|
|
public PieceColor getColor() {
|
|
return color;
|
|
}
|
|
|
|
public StartPosition getStartPosition() {
|
|
return startPosition;
|
|
}
|
|
|
|
public void setCoverageArea(boolean[][] area) {
|
|
coverageArea = area;
|
|
}
|
|
|
|
public boolean[][] getCoverageArea() {
|
|
return coverageArea;
|
|
}
|
|
|
|
public King getKing() {
|
|
return king;
|
|
}
|
|
|
|
public void setKing(King king) {
|
|
this.king = king;
|
|
}
|
|
|
|
}
|