bhlangonijr / chesslib

chess library for legal move generation, FEN/PGN parsing and more
Apache License 2.0
229 stars 80 forks source link

Custom PgnLoadListener.notifyProgress not invoked #61

Closed liebig closed 3 years ago

liebig commented 3 years ago

I have implemented the following Custom PgnLoadListener class:

import com.github.bhlangonijr.chesslib.pgn.PgnLoadListener;

public class CustomPgnLoadListener implements PgnLoadListener {
  @Override
  public void notifyProgress(int i) {
    System.out.println("Loaded " + i + " games...");
  }
}

And my main method looks like this:

(...)
public static void main(String[] args) throws Exception {
   CustomPgnLoadListener listener = new CustomPgnLoadListener();

    PgnHolder pgn = new PgnHolder("C:\\lichess\\lichess_db_standard_rated_2013-01.pgn");
    pgn.getListener().add(listener );
    pgn.loadPgn();

    System.out.println(pgn.getGames().size() + " Games loaded");
}
(...)

Unfortunately, however, the CustomPgnLoadListener.notifyProgress method is never invoked. Am I doing something wrong?

liebig commented 3 years ago

Can you please take a look at the pull request in a timely manner?