Пример #1
0
 /**
  * @return Card|bool
  */
 public function dealCard()
 {
     $ranks = ['A', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K'];
     $suits = ['♠', '♥', '♦', '♣'];
     //return $this->newCard('2', '♣');
     if ($this->Hand->hasCards()) {
         do {
             $Card = $this->newCard($ranks[mt_rand(0, 12)], $suits[mt_rand(0, 3)]);
         } while ($this->Hand->countCardInstances($Card) < $this->no_decks);
         $this->Hand->removeCard($Card);
         return $Card;
     }
     return false;
 }