Hand
in package
Hand of Blackjack cards.
Table of Contents
Properties
Methods
- addCard() : void
- Add a card to this hand.
- getCards() : array<string|int, Card>
- getNumCards() : int
- Return the number of cards in this hand.
- getValue() : int
- Return the hand's total blackjack value.
- hasBlackjack() : bool
- Does this hand have Blackjack?
- hasBusted() : bool
- Has this hand busted?
Properties
$cards
private
array<string|int, Card>
$cards
= []
$value
private
int
$value
= 0
Methods
addCard()
Add a card to this hand.
public
addCard(Card $card) : void
Parameters
- $card : Card
getCards()
public
getCards() : array<string|int, Card>
Return values
array<string|int, Card>getNumCards()
Return the number of cards in this hand.
public
getNumCards() : int
Return values
intgetValue()
Return the hand's total blackjack value.
public
getValue() : int
Return values
inthasBlackjack()
Does this hand have Blackjack?
public
hasBlackjack() : bool
Return values
boolhasBusted()
Has this hand busted?
public
hasBusted() : bool