/** Creates a new instance. */ public Reversi4() { super(4); ReversiBoard board = new ReversiBoard(); board.setCell(2, 2, Player.WHITE); board.setCell(1, 1, Player.WHITE); board.setCell(1, 2, Player.BLACK); board.setCell(2, 1, Player.BLACK); initial = new Reversi4Position(GameStatus.WHITE_MOVES, board); }
public int getScore() { board = this.getBoard(); color = this.getColor(); // call the getScore method of a particular board int score = board.getScore(color); return score; }
// returns true if a move for the current color can be made, false otherwise public boolean hasMove() { board = this.getBoard(); color = this.getColor(); // initialize to false boolean hasMove = false; // call the hasMove method of the specific board we are playing with if (board.hasMove(color)) hasMove = true; return hasMove; }