private void flipToken(int x, int y) { board.flipToken(x, y); if (board.getToken(x, y) == Boolean.TRUE) { sk.addPointBlack(); sk.remPointWhite(); } else { sk.remPointBlack(); sk.addPointWhite(); } }
/** * Locates information to the current player. * * @param x - The x coord on the board * @param y - The y coord on the board * @return - returns -2 for out of bounds, returns -1 for null, 0 for current player, and 1 for * opposite player */ private int isOppPlayer(int x, int y) { if (x < 0 || y < 0 || x >= size || y >= size) return -2; if (board.getToken(x, y) == currentPlayer) { return 0; } else if (board.getToken(x, y) == null) { return -1; } else { return 1; } }
private void placeToken(int x, int y, Boolean cP) { if (cP == Boolean.TRUE) { sk.addPointBlack(); } else if (cP == Boolean.FALSE) { sk.addPointWhite(); } sk.nextTurn(); board.placeToken(x, y, cP); }
public String printBoard() { return board.toString(); }
public Boolean getLocation(int x, int y) { return board.getToken(x, y); }