Abstract
Return the game corresponding to the given index.
Must be between 0 inclusive and Database.gameCount exclusive.
exception.InvalidPGN if the corresponding game cannot be parsed, or if the given game index is larger than the number of games in the underlying PGN data.
Return an Iterable object allowing to iterate over all the (valid) games within the database.
Example, to print the ASCII representation of all the games within a database:
const database = ... ;
for (const game of database.games()) {
console.log(game.ascii());
}
If the database contains some games that cannot be parsed (i.e. games for which the method Database.game would throw a exception.InvalidPGN exception), those games are ignored during the iteration. WARNING: for this reason, the number of games returned by the iterator may be lower than Database.gameCount.
Describe a set of chess games, each of them being represented by a Game object.