/** * @return array */ public function toArray() { return ['seatIndex' => $this->player->getSeat()->getSeatIndex(), 'hands' => $this->player->getSeat()->getHands()->map(function (HandBetPair $hand) { return ['hand' => ['value' => $hand->getHand()->getValue(), 'cards' => $hand->getHand()->getCards()->map(function (Card $card) { return ['rank' => $card->getRank(), 'suit' => $card->getSuit()]; })->elements()], 'bet' => $hand->getBet()]; })->elements()]; }
public function toArray() { return ['seatIndex' => $this->player->getSeat()->getSeatIndex(), 'name' => $this->player->getName()]; }
public function kickPlayer(Player $player, $reason) { if ($player instanceof ServerPlayer) { $this->removePlayerFromSeat($player->getSeat()); } elseif ($player instanceof SocketPlayer) { $this->enqueueMessage($player, new KickedMessage($reason))->always(function () use($player) { $player->getConnection()->getSocket()->close(); }); } }
public function ensurePlayerActive(Player $player, $value = null) { if ($player->getSeat() === null || $player->getTable() !== $this) { return \React\Promise\reject(new \RuntimeException('Player left table')); } return \React\Promise\resolve($value); }
/** * @return array */ public function toArray() { return ['seatIndex' => $this->player->getSeat()->getSeatIndex(), 'handIndex' => $this->findHandIndex(), 'card' => $this->serializeCard()]; }
/** * @return array */ public function toArray() { return ['seatIndex' => $this->player->getSeat()->getSeatIndex(), 'handIndex' => $this->findHandIndex(), 'result' => $this->getResult()]; }
/** * @return array */ public function toArray() { return ['seatIndex' => $this->player->getSeat()->getSeatIndex(), 'betAmount' => $this->betAmount, 'money' => $this->player->getChips()->getAmount()]; }