private Piece[][] board;
public cboard(){
this.board = new Piece[8][8];
}
public boolean isEmpty(int x, int y){
boolean empty= true;
if (board[x][y] != null){
empty= false;
}
return empty;
}
public void placePiece(Piece, int x, int y){
if(isEmpty(x, y)){
board[x][y] = piece;
}
}
}
조각에 대한 배열이 생성됩니까? 함수가 비어 있는지 확인해야합니다. 그렇지 않으면 장소가 비어 있지 않습니다.배열을 bluej로 선언하려면 어떻게해야합니까?