RosettaStone::AccountInfo Class Reference

AccountInfo class. More...

#include <Rosetta/Accounts/AccountInfo.hpp>

Public Member Functions

 AccountInfo ()
 Constructs anonymous account. More...
 
 AccountInfo (std::string &&email, std::string &&nickname)
 
 AccountInfo (std::string &&email, std::string &&nickname, std::vector< DeckInfo *> decks)
 
std::string GetEmail () const
 
std::string GetNickname () const
 
std::size_t GetNumOfDeck () const
 
DeckInfoGetDeck (std::size_t idx) const
 
void ShowDeckList () const
 Prints a list of decks. More...
 
bool CreateDeck (std::string name, CardClass deckClass)
 
bool DeleteDeck (std::size_t idx)
 

Detailed Description

AccountInfo class.

This class stores account information such as e-mail address and nickname. Also, it stores a list of decks. An account can make several decks. This information imports/exports from/to json file.

Constructor & Destructor Documentation

◆ AccountInfo() [1/3]

RosettaStone::AccountInfo::AccountInfo ( )

Constructs anonymous account.

◆ AccountInfo() [2/3]

RosettaStone::AccountInfo::AccountInfo ( std::string &&  email,
std::string &&  nickname 
)

Constructs account with given email and nickname.

Parameters
emailE-mail address of account.
nicknameNickname of account.

◆ AccountInfo() [3/3]

RosettaStone::AccountInfo::AccountInfo ( std::string &&  email,
std::string &&  nickname,
std::vector< DeckInfo *>  decks 
)

Constructs account with given email and nickname and fill deck list with decks.

Parameters
emailE-mail address of account.
nicknameNickname of account.
decksA list of decks.

Member Function Documentation

◆ CreateDeck()

bool RosettaStone::AccountInfo::CreateDeck ( std::string  name,
CardClass  deckClass 
)

Creates a deck with given name and deckClass.

Parameters
nameThe name of deck.
deckClassThe class of deck.
Returns
true if deck is created successfully, and false otherwise.

◆ DeleteDeck()

bool RosettaStone::AccountInfo::DeleteDeck ( std::size_t  idx)

Deletes a deck at idx.

Parameters
idxIndex of decks.
Returns
true if deck is deleted successfully, and false otherwise.

◆ GetDeck()

DeckInfo* RosettaStone::AccountInfo::GetDeck ( std::size_t  idx) const

Returns a pointer to deck at idx.

Parameters
idxIndex of decks.
Returns
A pointer to deck at idx.

◆ GetEmail()

std::string RosettaStone::AccountInfo::GetEmail ( ) const

Returns e-mail address of account.

Returns
E-mail address of account.

◆ GetNickname()

std::string RosettaStone::AccountInfo::GetNickname ( ) const

Returns nickname of account.

Returns
Nickname of account.

◆ GetNumOfDeck()

std::size_t RosettaStone::AccountInfo::GetNumOfDeck ( ) const

Returns the number of decks.

Returns
Number of decks.

◆ ShowDeckList()

void RosettaStone::AccountInfo::ShowDeckList ( ) const

Prints a list of decks.


The documentation for this class was generated from the following file: