Documentation

Hand
in package

Hand of Blackjack cards.

Table of Contents

Properties

$cards  : array<string|int, Card>
$value  : int

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
int

getValue()

Return the hand's total blackjack value.

public getValue() : int
Return values
int

hasBlackjack()

Does this hand have Blackjack?

public hasBlackjack() : bool
Return values
bool

hasBusted()

Has this hand busted?

public hasBusted() : bool
Return values
bool

        
On this page

Search results