Overview

Namespaces

  • pgn
    • exceptions
    • tags
  • utils

Classes

  • Game
  • PGN
  • Overview
  • Namespace
  • Class

Class Game

Description of Game: A PGN Game is composed by a set of tags (at least STR) and a movetext section: The movetext section is composed of chess moves, move number indications, optional annotations, and a single concluding game termination marker.

Namespace: pgn
Author: Geraldo
See: pgn_standard.txt
Located at pgn/Game.php
Methods summary
public
# __construct( )

Creates an empty Game

Creates an empty Game

public string
# __toString( )

Returns a string representation of the Game object

Returns a string representation of the Game object

Returns

string
a string representation of the PGN object
public string
# toString( string $endLine = "\n" )

Returns a string representation of the Game object

Returns a string representation of the Game object

Parameters

$endLine

$endl The end-line character (default: "\n"). Example:

<code>
<?php
$object = new Game;
$object->toString("<br />");
</code>

Returns

string
a string representation of the PGN object
public
# parse( string $unparsedGame )

Parses a string containing a game and fills movetext and tags attributes. The tag attribute is filled as an associative array (TagName => TagObject)

Parses a string containing a game and fills movetext and tags attributes. The tag attribute is filled as an associative array (TagName => TagObject)

Parameters

$unparsedGame
string containing one PGN Game

Throws

pgn\exceptions\InvalidGameFormatException

throws an exception if the parameter is not a string or if it doesn't have the correct fields, i.e. the move text and the seven roster tags

Assert(123)

throws pgn\exceptions\InvalidGameFormatException

Assert(null)

throws pgn\exceptions\InvalidGameFormatException
public pgn\tags\Tag
# getTag( string $tagName )

Parameters

$tagName

Returns

pgn\tags\Tag
public
# addTag( pgn\tags\Tag $tag )

Parameters

$tag
protected boolean
# checkMoveText( string $uncheckedMoveText )

Parameters

$uncheckedMoveText

Returns

boolean
protected
# checkSetUpAndFEN( )
API documentation generated by ApiGen