public function dealCardToDealer()
 {
     return parent::dealCardToDealer()->then(function ($card) {
         $this->broadcast(new CardDealtToDealerMessage($card));
         return $card;
     });
 }
Example #2
0
 /**
  * @return Promise
  */
 private function playDealerHand()
 {
     return \Blackjack\Promise\timedResolve(self::PAUSE_SPEED)->then(function () {
         if ($this->table->getDealerHand()->getValue() >= 17) {
             return null;
         }
         return $this->table->dealCardToDealer()->then(function () {
             return $this->playDealerHand();
         });
     });
 }