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

#include <CategorizedHand.h>

Public Member Functions

 CategorizedHand ()=default
 CategorizedHand (HandRating::HandType type, const std::vector< Card > &cards)
auto getSum () const -> int
auto getScore () const -> int
auto getType () const -> HandRating::HandType
auto getCards () const -> const std::vector< Card > &
auto setHandType (HandRating::HandType newType) -> void
auto setCards (const std::vector< Card > &newCards) -> void
 Sets the entire card vector at once.
auto addCard (const 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
std::vector< CardimportantCards

Constructor & Destructor Documentation

◆ CategorizedHand() [1/2]

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

◆ CategorizedHand() [2/2]

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

Member Function Documentation

◆ addCard()

auto CategorizedHand::addCard ( const 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:

◆ getCards()

auto CategorizedHand::getCards ( ) 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:

◆ 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:

◆ setHandType()

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

Member Data Documentation

◆ importantCards

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

◆ typeOfHand

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

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