Beispiel #1
0
 public int getNumOfPlies() {
   int num = 0;
   int index = 0;
   while (m_moves.hasNextMove(index)) {
     index = m_moves.goForward(index);
     num++;
   }
   return num;
 }
Beispiel #2
0
  public Move[] getMainLine() {
    int num = 0;
    int index = m_cur;
    while (m_moves.hasNextMove(index)) {
      index = m_moves.goForward(index);
      num++;
    }

    Move[] moves = new Move[num];
    for (int i = 0; i < num; i++) {
      moves[i] = goForwardAndGetMove(true);
    }

    m_position.setNotifyListeners(false);
    for (int i = 0; i < moves.length; i++) m_position.undoMove();
    m_position.setNotifyListeners(true);

    return moves;
  }
Beispiel #3
0
 public boolean hasNextMove() {
   return m_moves.hasNextMove(m_cur);
 }