Bugfixes + support for getting shorter parsing format

This commit is contained in:
DHTMLGoodies
2017-08-17 13:53:35 +02:00
parent 9490f2cd09
commit 68d6e084c9
7 changed files with 185 additions and 18 deletions

View File

@@ -7,14 +7,23 @@ class GameParser
private $game;
private $fen;
private $fenParser0x88;
private $shortVersion;
public function __construct()
{
$this->fenParser0x88 = new FenParser0x88();
}
public function getParsedGame($game)
/**
* @param array $game
* @param bool $short for only from and to squares
* @return mixed
*/
public function getParsedGame($game, $short = false)
{
$this->game = $game;
$this->shortVersion = $short;
$this->fen = $this->getStartFen();
$this->fenParser0x88->newGame($this->fen);
@@ -48,6 +57,8 @@ class GameParser
$this->fenParser0x88->setFen($fen);
}
$move = $this->fenParser0x88->getParsed($move);
}
private function parseVariations(&$variations)