Code cleanup parser

This commit is contained in:
DHTMLGoodies
2013-02-07 17:45:11 +01:00
parent 929c109bb9
commit 256b4ea739
2 changed files with 66 additions and 37 deletions

View File

@@ -12,8 +12,16 @@ class PgnGameParser{
'event','site','white','black','result','plycount','eco','fen','timecontrol','round','date','annotator','termination'
);
public function __construct($pgnGame){
public function __construct($pgnGame = null){
if(isset($pgnGame)){
$this->pgnGame = trim($pgnGame);
$this->moveBuilder = new MoveBuilder();
}
}
public function setPgn($pgnGame){
$this->pgnGame = trim($pgnGame);
$this->gameData = array();
$this->moveBuilder = new MoveBuilder();
}