|
| __construct ( $pgnContent) |
| Construct a new ChesParser.
|
|
| createOutputJson ( $gameNum=0) |
| Returns a JSON string for the javascript module.
|
|
| convertParserOutput ( $moves, $fenParts, $moveObject) |
| Convert the parser output into the board, token, ply object used in the javascript module.
|
|
| createAnnotationJson ( $variationObj, $fenParts, $index) |
| Will pass variations to the JS module to insert into the game.
|
|
| checkSpecialMove ( $to, $from, $token, $fenParts) |
| Sets the special move field of the JSON "ply" section.
|
|
| getFenParts ( $fen) |
| Extracts en passant target and color to play from FEN.
|
|
| getPgnParserOutput ( $gameNum=0) |
| Extract needed data from the PGN parser output.
|
|
◆ __construct()
MediaWiki\Extension\ChessBrowser\ChessParser::__construct |
( |
| $pgnContent | ) |
|
Construct a new ChesParser.
- Parameters
-
◆ checkSpecialMove()
MediaWiki\Extension\ChessBrowser\ChessParser::checkSpecialMove |
( |
| $to, |
|
|
| $from, |
|
|
| $token, |
|
|
| $fenParts ) |
Sets the special move field of the JSON "ply" section.
- Since
- 0.2.0
- Parameters
-
int | $to | |
int | $from | |
string | $token | |
array | $fenParts | |
- Returns
- array
◆ convertParserOutput()
MediaWiki\Extension\ChessBrowser\ChessParser::convertParserOutput |
( |
| $moves, |
|
|
| $fenParts, |
|
|
| $moveObject ) |
Convert the parser output into the board, token, ply object used in the javascript module.
- Parameters
-
array | $moves | The list of moves output by the PgnParser |
array | $fenParts | The fen string broken down by getFenParts |
array | $moveObject | The movereferences from the PgnParser |
- Returns
- array
◆ createAnnotationJson()
MediaWiki\Extension\ChessBrowser\ChessParser::createAnnotationJson |
( |
| $variationObj, |
|
|
| $fenParts, |
|
|
| $index ) |
Will pass variations to the JS module to insert into the game.
- Parameters
-
array | $variationObj | list of variations associated with a move. Organized as a list of lists of moves, so 1. e4 (1. c4 c5) (1.d4) would be: [ [ { 'm': 'c4', 'from': 'c2', 'to': 'c4', 'fen': '...' }, { 'm': 'c5', 'from': 'c7', 'to': 'c5', 'fen': '...' } ], [ { 'm': 'd4', 'from': 'd2', 'to': 'd4', 'fen': '...' } ] ] |
array | $fenParts | The starting fen broken down into semantic chunks |
int | $index | Ply of the variation's parent move. |
- Returns
- array
◆ createOutputJson()
MediaWiki\Extension\ChessBrowser\ChessParser::createOutputJson |
( |
| $gameNum = 0 | ) |
|
Returns a JSON string for the javascript module.
- Since
- 0.2.0
- Parameters
-
int | $gameNum | Passed directly to the PGN parsing library |
- Returns
- array
◆ getFenParts()
MediaWiki\Extension\ChessBrowser\ChessParser::getFenParts |
( |
| $fen | ) |
|
Extracts en passant target and color to play from FEN.
- Since
- 0.2.0
- Parameters
-
- Returns
- array
◆ getPgnParserOutput()
MediaWiki\Extension\ChessBrowser\ChessParser::getPgnParserOutput |
( |
| $gameNum = 0 | ) |
|
Extract needed data from the PGN parser output.
- Since
- 0.2.0
- Parameters
-
int | $gameNum | Passed directly to the PGN parsing library |
- Returns
- array
The documentation for this class was generated from the following file: