private void doReverseOpponentsInBetweenExclusive( Cursor cursorFrom, Cursor cursorTo, Direction direction) { Cursor cursor = cursorFrom.getCopy(); while (true) { cursor.moveIn(direction); if (cursor.isSameLocationWith(cursorTo)) { break; } board[cursor.getX()][cursor.getY()].toggleColor(); } }
private Square.Status statusOn(Cursor cursor) { return board[cursor.getX()][cursor.getY()].getStatus(); }