/** * @return Player */ public function getInvited() { if (!$this->creator) { return null; } if ($this->creator->isWhite()) { return $this->getPlayer('black'); } return $this->getPlayer('white'); }
/** * Tell whether or not this player can castle queen side * * @return bool **/ public function canCastleQueenSide(Player $player) { return $this->canCastle($player->getKing(), -4); }
/** * @return Player */ public function createPlayer($game, $color) { $player = new Player($color); $player->setGame($game); $player->setPieces($this->createPieces($player)); return $player; }
/** * Get the socket file * * @return string **/ public function getFile(Player $player) { return $this->dir . '/' . $player->getFullHash() . '.json'; }
public function update(Player $player) { $player->setTime(time()); }
public function getGame() { return $this->player->getGame(); }