public function toArray() { return ['dealerCard' => $this->serializeCard($this->dealerHand->getFaceUpCard()), 'playerHand' => $this->serializeHand($this->playerHand), 'money' => $this->player->getChips()->getAmount()]; }
/** * @param DealerHand $dealerHand * * @return bool */ public function drawnWithHand(DealerHand $dealerHand) { if ($this->isBusted() && $dealerHand->isBusted()) { return false; } return $dealerHand->getValue() === $this->getValue(); }