Beispiel #1
0
  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();
    }
  }
Beispiel #2
0
 private Square.Status statusOn(Cursor cursor) {
   return board[cursor.getX()][cursor.getY()].getStatus();
 }