RosettaStone::DeckInfo Class Reference
#include <Rosetta/Accounts/DeckInfo.hpp>
Public Member Functions | |
| DeckInfo () | |
| Default constructor. More... | |
| DeckInfo (std::string name, CardClass deckClass) | |
| std::string | GetName () const |
| CardClass | GetClass () const |
| std::size_t | GetNumOfCards () const |
| std::size_t | GetUniqueNumOfCards () const |
| std::size_t | GetNumCardInDeck (std::string cardID) |
| std::vector< Card > | GetPrimitiveDeck () const |
| std::pair< std::string, std::size_t > | GetCard (std::size_t idx) const |
| void | ShowCardList () const |
| Prints card list in deck. More... | |
| bool | AddCard (std::string cardID, std::size_t numCardToAdd) |
| bool | DeleteCard (std::string cardID, std::size_t numCardToDelete) |
Detailed Description
DeckInfo class.
This class stores deck information that contains exactly 30 cards. This information imports/exports from/to json file.
Constructor & Destructor Documentation
◆ DeckInfo() [1/2]
| RosettaStone::DeckInfo::DeckInfo | ( | ) |
Default constructor.
◆ DeckInfo() [2/2]
| RosettaStone::DeckInfo::DeckInfo | ( | std::string | name, |
| CardClass | deckClass | ||
| ) |
Constructs deck with given name and deckClass.
- Parameters
-
name The name of deck. deckClass The class of deck.
Member Function Documentation
◆ AddCard()
| bool RosettaStone::DeckInfo::AddCard | ( | std::string | cardID, |
| std::size_t | numCardToAdd | ||
| ) |
Add card(s) to deck with given cardID and numCardToAdd.
- Parameters
-
cardID The ID of the card to add to deck. numCardToAdd The number of card to add to deck.
- Returns
- true if card(s) is added to deck successfully, and false otherwise.
◆ DeleteCard()
| bool RosettaStone::DeckInfo::DeleteCard | ( | std::string | cardID, |
| std::size_t | numCardToDelete | ||
| ) |
Delete card(s) from deck with given cardID and numCardToDelete.
- Parameters
-
cardID The ID of the card to delete from deck. numCardToDelete The number of card to delete from deck.
- Returns
- true if card(s) is deleted from deck successfully, and false otherwise.
◆ GetCard()
| std::pair<std::string, std::size_t> RosettaStone::DeckInfo::GetCard | ( | std::size_t | idx | ) | const |
Returns card ID and the number of card at idx in deck.
- Parameters
-
idx Index of cards in deck.
- Returns
- card ID and the number of card at
idxin deck.
◆ GetClass()
| CardClass RosettaStone::DeckInfo::GetClass | ( | ) | const |
Returns the class of deck.
- Returns
- The class of deck.
◆ GetName()
| std::string RosettaStone::DeckInfo::GetName | ( | ) | const |
Returns the name of deck.
- Returns
- The name of deck.
◆ GetNumCardInDeck()
| std::size_t RosettaStone::DeckInfo::GetNumCardInDeck | ( | std::string | cardID | ) |
Returns the number of cards in deck that matches cardID.
- Parameters
-
cardID The ID of the card.
- Returns
- The number of cards in deck that matches
cardID.
◆ GetNumOfCards()
| std::size_t RosettaStone::DeckInfo::GetNumOfCards | ( | ) | const |
Returns the number of cards in deck.
- Returns
- The number of cards in deck.
◆ GetPrimitiveDeck()
| std::vector<Card> RosettaStone::DeckInfo::GetPrimitiveDeck | ( | ) | const |
Creates a deck from a list of pointers to cards to play game.
- Returns
- A deck from a list of pointers to cards.
◆ GetUniqueNumOfCards()
| std::size_t RosettaStone::DeckInfo::GetUniqueNumOfCards | ( | ) | const |
Returns the unique number of cards in deck.
- Returns
- The unique number of cards in deck.
◆ ShowCardList()
| void RosettaStone::DeckInfo::ShowCardList | ( | ) | const |
Prints card list in deck.
The documentation for this class was generated from the following file:
- Rosetta/Accounts/DeckInfo.hpp
1.8.14