From e939a58b38bc1f1dedb1ef75f7e3110ce68c0b1f Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Wed, 14 Jun 2023 15:48:15 +0200 Subject: [PATCH] fix #2: Add common PGN tags in "specialMetadata" array. --- CHESS_JSON.php | 4 ++-- GameParser.php | 2 +- PgnGameParser.php | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHESS_JSON.php b/CHESS_JSON.php index 7f9a77e..8aa2674 100755 --- a/CHESS_JSON.php +++ b/CHESS_JSON.php @@ -15,13 +15,13 @@ class CHESS_JSON { const MOVE_CAPTURE = 'capture'; const MOVE_PROMOTE_TO = 'promoteTo'; const MOVE_CASTLE = 'castle'; - const MOVE_PARSED = 'castle'; + const MOVE_PARSED = 'parsed'; const GAME_METADATA = 'metadata'; const GAME_EVENT = 'event'; const GAME_WHITE = 'white'; const GAME_BLACK = 'black'; - const GAME_ECO = 'black'; + const GAME_ECO = 'eco'; const PGN_KEY_ACTION_ARROW = "ar"; const PGN_KEY_ACTION_HIGHLIGHT = "sq"; diff --git a/GameParser.php b/GameParser.php index ce07704..614260f 100755 --- a/GameParser.php +++ b/GameParser.php @@ -75,4 +75,4 @@ class GameParser { return $this->game[CHESS_JSON::FEN]; } -} \ No newline at end of file +} diff --git a/PgnGameParser.php b/PgnGameParser.php index 7cb7ba7..9301a30 100755 --- a/PgnGameParser.php +++ b/PgnGameParser.php @@ -10,7 +10,9 @@ class PgnGameParser{ private $specialMetadata = array( 'event','site','white','black','result','plycount','eco','fen', - 'timecontrol','round','date','annotator','termination' + 'timecontrol','round','date','annotator','termination', + 'whiteelo', 'blackelo', 'whiteteam', 'blackteam', + 'opening', 'eventdate', 'seat' ); public function __construct($pgnGame = null){