OthelloState extends TwoDimensionalBoardGameState { OthelloState pass(){ OthelloState temp = this.copy(); temp.numPasses = this.numPasses + 1; temp.nextPlayer = (this.nextPlayer + 1) % 2; return temp; } OthelloState();  OthelloState(OthelloState state);  OthelloState(int[][] board, int nextPlay, List<Integer> win); int getNumPlayers(); @Override boolean endState(); @Override boolean moveSinglePoint(Point goTo); @SuppressWarnings("unchecked") @Override Set<T> possibleBoardGameStates(T currentState); @SuppressWarnings("unchecked") @Override OthelloState copy(); @Override List<Integer> getWinners(); @Override void setupStartingBoard(); @Override int getBoardWidth(); @Override int getBoardHeight(); @Override char[] getPlayerSymbols(); @Override Color[] getPlayerColors(); @Override boolean moveDoublePoint(Point goTo, Point moveTo); @Override boolean moveOnePiece(); String toString(); static final int BLACK_CHIP; static final int WHITE_CHIP; }
@Test public void testPass(){ OthelloState start = new OthelloState(); assertTrue(start.numPasses == 0 && start.getCurrentPlayer() == 0 && !start.endState()); start = start.pass(); assertTrue(start.numPasses == 1 && start.getCurrentPlayer() == 1 && !start.endState()); start = start.pass(); assertTrue(start.numPasses == 2 && start.getCurrentPlayer() == 0 && start.endState()); }