コード例 #1
0
ファイル: LegStats.php プロジェクト: nehlsen/fdadsb
 public function getCountShotsOf(Player $player)
 {
     if ($player == $this->leg->getGame()->getPlayer1()) {
         return $this->leg->getPlayer1shots();
     } elseif ($player == $this->leg->getGame()->getPlayer2()) {
         return $this->leg->getPlayer2shots();
     } else {
         return 0;
     }
 }
コード例 #2
0
ファイル: GameGearsSimple.php プロジェクト: nehlsen/fdadsb
 /**
  * @inheritDoc
  */
 protected function handleLegCompleted(Leg $leg)
 {
     // check if this completes the game
     //        $game = $this->getGame(); -> does not yet know that leg is closed
     $game = $leg->getGame();
     $game->updateWonLegs();
     $winner = $this->checkForWinner($game);
     if (null !== $winner) {
         $game->setWinner($winner);
         $this->setGameCompleted($game);
     }
 }
コード例 #3
0
ファイル: Turn.php プロジェクト: nehlsen/fdadsb
 public function __construct(Leg $leg, Player $player)
 {
     $this->leg = $leg;
     $this->player = $player;
     $this->created = new \DateTime();
     $leg->addTurn($this);
 }