示例#1
0
 /**
  * The player draws the game
  *
  * @param Player $player
  * @return void
  */
 public function claimDraw(Player $player)
 {
     $game = $player->getGame();
     if ($game->getIsPlayable() && $game->isThreefoldRepetition() && $player->isMyTurn()) {
         $game->setStatus(Game::DRAW);
         $this->finish($game);
         $game->addEventToStacks(array('type' => 'end'));
         $this->logger->notice($player, 'Player:claimDraw');
     } else {
         $this->logger->warn($player, 'Player:claimDraw FAIL');
     }
 }