Brunot
Loading...
Searching...
No Matches
CategorizedHand Struct Reference

#include <CategorizedHand.h>

Collaboration diagram for CategorizedHand:
[legend]

Public Member Functions

 CategorizedHand ()=default
 CategorizedHand (HandRating::HandType type, const std::vector< Card * > &cards)
 CategorizedHand (HandRating::HandType type, const std::vector< Card * > &cards, bool isVertical, bool isHorizontal)
auto getSum () const -> int
auto getScore () const -> int
auto getType () const -> HandRating::HandType
auto getContributingCards () const -> const std::vector< Card * > &
auto getFullHand () const -> const std::vector< Card * > &
auto getVertical () const -> bool
auto setHandType (HandRating::HandType newType) -> void
auto setVertical (bool isVertical) -> void
auto operator< (const CategorizedHand &other) const -> bool
 Comparison operator for sorting against other CategorizedHands.
auto setCards (const std::vector< Card * > &newCards) -> void
 Sets the entire card vector at once.
auto setFullHand (const std::vector< Card * > &newCards) -> void
 Sets the full hand cards.
auto addCard (Card *newCard) -> void
 Pushes back a new card into the card vector.
auto getAsString () const -> std::string
 Constructs a string that represents the data in the hand.
auto printCards () const -> void
 Prints out all the cards that comprise the hand in the log.

Private Attributes

HandRating::HandType typeOfHand = HandRating::HandType::nothing
 The specific poker hand that the hand is worth.
std::vector< Card * > importantCards
 The cards in the hand that contribute to the score.
std::vector< Card * > fullHand
 All the cards in the players hand.
bool vertical = false
 If the current hand is vertical on the board or not.

Constructor & Destructor Documentation

◆ CategorizedHand() [1/3]

CategorizedHand::CategorizedHand ( )
default
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CategorizedHand() [2/3]

CategorizedHand::CategorizedHand ( HandRating::HandType type,
const std::vector< Card * > & cards )

◆ CategorizedHand() [3/3]

CategorizedHand::CategorizedHand ( HandRating::HandType type,
const std::vector< Card * > & cards,
bool isVertical,
bool isHorizontal )

Member Function Documentation

◆ addCard()

auto CategorizedHand::addCard ( Card * newCard) ->void

Pushes back a new card into the card vector.

Parameters
newCardThe card you want to add to the hand
Here is the caller graph for this function:

◆ getAsString()

auto CategorizedHand::getAsString ( ) const->std::string

Constructs a string that represents the data in the hand.

Returns
A string in the format of "hand of type [Type] that was worth [Score] points"
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getContributingCards()

auto CategorizedHand::getContributingCards ( ) const->conststd::vector< Card * > &
Here is the caller graph for this function:

◆ getFullHand()

auto CategorizedHand::getFullHand ( ) const->conststd::vector< Card * > &
Here is the caller graph for this function:

◆ getScore()

auto CategorizedHand::getScore ( ) const->int
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSum()

auto CategorizedHand::getSum ( ) const->int
Here is the caller graph for this function:

◆ getType()

auto CategorizedHand::getType ( ) const->HandRating::HandType
Here is the caller graph for this function:

◆ getVertical()

auto CategorizedHand::getVertical ( ) const->bool
Here is the caller graph for this function:

◆ operator<()

auto CategorizedHand::operator< ( const CategorizedHand & other) const->bool

Comparison operator for sorting against other CategorizedHands.

Here is the call graph for this function:

◆ printCards()

auto CategorizedHand::printCards ( ) const->void

Prints out all the cards that comprise the hand in the log.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCards()

auto CategorizedHand::setCards ( const std::vector< Card * > & newCards) ->void

Sets the entire card vector at once.

Parameters
newCardsThe vector you want to assign to this CategorizedHand
Here is the caller graph for this function:

◆ setFullHand()

auto CategorizedHand::setFullHand ( const std::vector< Card * > & newCards) ->void

Sets the full hand cards.

Parameters
newCardsThe vector you want to assign to this CategorizedHand
Here is the caller graph for this function:

◆ setHandType()

auto CategorizedHand::setHandType ( HandRating::HandType newType) ->void
Here is the caller graph for this function:

◆ setVertical()

auto CategorizedHand::setVertical ( bool isVertical) ->void
Here is the caller graph for this function:

Member Data Documentation

◆ fullHand

std::vector<Card*> CategorizedHand::fullHand
private

All the cards in the players hand.

◆ importantCards

std::vector<Card*> CategorizedHand::importantCards
private

The cards in the hand that contribute to the score.

◆ typeOfHand

HandRating::HandType CategorizedHand::typeOfHand = HandRating::HandType::nothing
private

The specific poker hand that the hand is worth.

◆ vertical

bool CategorizedHand::vertical = false
private

If the current hand is vertical on the board or not.


The documentation for this struct was generated from the following files: