コード例 #1
0
ファイル: Game.php プロジェクト: Austin-Pray/lichess
 /**
  * @return Player
  */
 public function getInvited()
 {
     if (!$this->creator) {
         return null;
     }
     if ($this->creator->isWhite()) {
         return $this->getPlayer('black');
     }
     return $this->getPlayer('white');
 }
コード例 #2
0
ファイル: Analyser.php プロジェクト: Austin-Pray/lichess
 /**
  * Tell whether or not this player can castle queen side
  *
  * @return bool
  **/
 public function canCastleQueenSide(Player $player)
 {
     return $this->canCastle($player->getKing(), -4);
 }
コード例 #3
0
ファイル: Generator.php プロジェクト: Austin-Pray/lichess
 /**
  * @return Player
  */
 public function createPlayer($game, $color)
 {
     $player = new Player($color);
     $player->setGame($game);
     $player->setPieces($this->createPieces($player));
     return $player;
 }
コード例 #4
0
ファイル: Socket.php プロジェクト: Austin-Pray/lichess
 /**
  * Get the socket file
  *
  * @return string
  **/
 public function getFile(Player $player)
 {
     return $this->dir . '/' . $player->getFullHash() . '.json';
 }
コード例 #5
0
ファイル: Synchronizer.php プロジェクト: Austin-Pray/lichess
 public function update(Player $player)
 {
     $player->setTime(time());
 }
コード例 #6
0
ファイル: Piece.php プロジェクト: Austin-Pray/lichess
 public function getGame()
 {
     return $this->player->getGame();
 }