RosettaStone::DeckInfo Class Reference

DeckInfo class. More...

#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< CardGetPrimitiveDeck () 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
nameThe name of deck.
deckClassThe 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
cardIDThe ID of the card to add to deck.
numCardToAddThe 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
cardIDThe ID of the card to delete from deck.
numCardToDeleteThe 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
idxIndex of cards in deck.
Returns
card ID and the number of card at idx in 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
cardIDThe 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: