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