Brunot
Loading...
Searching...
No Matches
CategorizedHand.h
Go to the documentation of this file.
1
12// ____ __ __ __
13// /\__ _\/\ \ /\ \/\ \
14// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
15// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
16// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
17// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
18// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
19
20
21#pragma once
22
23#include <vector>
24
25#include "Component/Card.h"
27
28struct CardSet;
29class Card;
30
32{
33 CategorizedHand() = default;
34 CategorizedHand(HandRating::HandType type, const std::vector<Card*>& cards);
35 CategorizedHand(HandRating::HandType type, const std::vector<Card*>& cards, bool isVertical, bool isHorizontal);
36
37 auto getSum() const -> int;
38 auto getScore() const -> int;
39 auto getType() const -> HandRating::HandType;
40 auto getContributingCards() const -> const std::vector<Card*>&;
41 auto getFullHand() const -> const std::vector<Card*>&;
42 auto getVertical() const -> bool;
43
44 auto setHandType(HandRating::HandType newType) -> void;
45 auto setVertical(bool isVertical) -> void;
46
47
49 auto operator<(const CategorizedHand& other) const -> bool;
50
55 auto setCards(const std::vector<Card*>& newCards) -> void;
56
61 auto setFullHand(const std::vector<Card*>& newCards) -> void;
62
67 auto addCard(Card* newCard) -> void;
68
73 auto getAsString() const -> std::string;
74
78 auto printCards() const -> void;
79
80private:
81
83 HandRating::HandType typeOfHand = HandRating::HandType::nothing;
84
86 std::vector<Card*> importantCards;
87
89 std::vector<Card*> fullHand;
90
92 bool vertical = false;
93};
The card component that is moved around on the board.
A class that can get the score of a hand.
Definition Card.h:34
Definition HandRating.h:30
HandType
Definition HandRating.h:35
auto setCards(const std::vector< Card * > &newCards) -> void
Sets the entire card vector at once.
Definition CategorizedHand.cpp:75
auto getFullHand() const -> const std::vector< Card * > &
Definition CategorizedHand.cpp:55
bool vertical
If the current hand is vertical on the board or not.
Definition CategorizedHand.h:92
auto setHandType(HandRating::HandType newType) -> void
Definition CategorizedHand.cpp:65
auto getType() const -> HandRating::HandType
Definition CategorizedHand.cpp:45
HandRating::HandType typeOfHand
The specific poker hand that the hand is worth.
Definition CategorizedHand.h:83
auto getContributingCards() const -> const std::vector< Card * > &
Definition CategorizedHand.cpp:50
auto getSum() const -> int
Definition CategorizedHand.cpp:30
auto addCard(Card *newCard) -> void
Pushes back a new card into the card vector.
Definition CategorizedHand.cpp:95
auto getAsString() const -> std::string
Constructs a string that represents the data in the hand.
Definition CategorizedHand.cpp:100
CategorizedHand()=default
auto getVertical() const -> bool
Definition CategorizedHand.cpp:60
std::vector< Card * > importantCards
The cards in the hand that contribute to the score.
Definition CategorizedHand.h:86
auto printCards() const -> void
Prints out all the cards that comprise the hand in the log.
Definition CategorizedHand.cpp:105
auto getScore() const -> int
Definition CategorizedHand.cpp:40
auto setVertical(bool isVertical) -> void
Definition CategorizedHand.cpp:70
auto setFullHand(const std::vector< Card * > &newCards) -> void
Sets the full hand cards.
Definition CategorizedHand.cpp:80
std::vector< Card * > fullHand
All the cards in the players hand.
Definition CategorizedHand.h:89