Beispiel #1
0
 public function restockDeck()
 {
     $this->cards = new Vector();
     $suit = [Card::SUIT_CLUBS, Card::SUIT_SPADES, Card::SUIT_HEARTS, Card::SUIT_DIAMONDS];
     foreach ($suit as $cardSuit) {
         for ($rank = Card::RANK_ACE; $rank <= Card::RANK_KING; $rank++) {
             if ($rank === 11) {
                 continue;
             }
             $this->cards->pushBack(new Card($rank, $cardSuit));
         }
     }
     $cards = clone $this->cards;
     for ($deck = 0; $deck < $this->decks; $deck++) {
         $this->cards->append($cards);
     }
 }
Beispiel #2
0
 /**
  * @param Card $card
  */
 public function addCard(Card $card)
 {
     $this->cards->pushBack($card);
 }