Esempio n. 1
0
 /**
  * @param PgnGame $pgnGame
  * @return string
  */
 private function getTitle(PgnGame $pgnGame) : string
 {
     $chessGameService = new ChessGameService();
     $chessGameService->_parseFen($pgnGame->getFen());
     switch ($chessGameService->toMove()) {
         case 'B':
             $text = 'Ход черных. ';
             break;
         default:
             $text = 'Ход белых. ';
     }
     switch ($pgnGame->getResult()) {
         case '1-0':
             $text .= "Белые выигрывают";
             break;
         case '1/2-1/2':
             $text .= "Ничья";
             break;
         case '0-1':
             $text .= "Черные выигрывают";
             break;
     }
     return $text;
 }
Esempio n. 2
0
 /**
  * @param $pgn
  */
 private function completeCurrentGame($pgn)
 {
     $this->currentGame->setPgn($pgn);
     $this->games[] = $this->currentGame;
     $this->multiLineAnnotationDepth = 0;
 }