Closed liebig closed 3 years ago
For the implementation I count all lines which start with the string "[Event " because the Event field is mandatory by PGN definition. This implementation is fast. Counting 121332 games took my PC 707ms while loading the PGN file took 18597ms.
Fixed here: https://github.com/bhlangonijr/chesslib/commit/8b167cf3749d681b459592a210016d5b3cc4011d. Should be available on version 1.3.1
A function to count the number of games in a PGN file before loading would be interesting, as this would also allow a PgnLoadListener to calculate the exact percentage of games currently processed. I will create a pull request for this implementation.