chess.pgn.Parser Class
Model to PGN parser. Takes a chess.model.Game as only argument and returns a PGN string for the game.
Constructor
chess.pgn.Parser
(
-
model
Parameters:
-
model
chess.model.Game
Example:
var game = new chess.model.Game();
game.setMetadataValue('white','Magnus Carlsen');
game.setMetadataValue('black','Levon Aronian');
game.appendMove('e4');
game.appendMove('e5');
var parser = new chess.pgn.Parser(game);
console.log(parser.getPgn());
Methods
getMovesInBranch
(
String
private
-
moves
-
moveIndex
Return main line of moves or a variation