Account Class Reference

#include <account.hpp>

List of all members.


Detailed Description

A player's account.

Definition at line 47 of file account.hpp.

Public Member Functions

 Account (const std::string &name, const std::string &password, const std::string &email, int id=-1)
 Constructor with initial account info.
 Account (const std::string &name, const std::string &password, const std::string &email, const Characters &characters)
 Constructor with initial account info.
 ~Account ()
 Destructor.
void setName (const std::string &name)
 Set the user name.
const std::string & getName () const
 Get the user name.
void setPassword (const std::string &password)
 Set the user password.
const std::string getPassword (void) const
 Get the user password.
void setEmail (const std::string &email)
 Set the user email address.
const std::string & getEmail (void) const
 Get the user email address.
void setLevel (AccountLevel level)
 Set the account level.
AccountLevel getLevel () const
 Get the account level.
void setCharacters (const Characters &characters)
 Set the characters.
void addCharacter (CharacterPtr character)
 Add a new character.
bool delCharacter (std::string const &name)
 Remove a character.
CharactersgetCharacters ()
 Get all the characters.
CharacterPtr getCharacter (const std::string &name)
 Get a character by name.
int getID () const
 Get account ID.
void setID (int)
 Set account ID.

Private Member Functions

 Account ()
 Account (Account const &rhs)
Accountoperator= (Account const &rhs)

Private Attributes

int mID
 unique id
std::string mName
 user name
std::string mPassword
 user password (encrypted)
std::string mEmail
 user email address
Characters mCharacters
 Character data.
AccountLevel mLevel
 account level


Constructor & Destructor Documentation

Account::Account const std::string &  name,
const std::string &  password,
const std::string &  email,
int  id = -1
 

Constructor with initial account info.

Parameters:
name the user name.
password the user password.
email the user email.

Definition at line 33 of file account.cpp.

Account::Account const std::string &  name,
const std::string &  password,
const std::string &  email,
const Characters characters
 

Constructor with initial account info.

Parameters:
name the user name.
password the user password.
email the user email.
characters the characters.

Definition at line 51 of file account.cpp.

Account::~Account  ) 
 

Destructor.

Definition at line 68 of file account.cpp.

Account::Account  )  [private]
 

Account::Account Account const &  rhs  )  [private]
 


Member Function Documentation

void Account::addCharacter CharacterPtr  character  ) 
 

Add a new character.

Parameters:
character the new character.

Definition at line 170 of file account.cpp.

bool Account::delCharacter std::string const &  name  ) 
 

Remove a character.

Parameters:
name The character's name to delete.

Definition at line 180 of file account.cpp.

CharacterPtr Account::getCharacter const std::string &  name  ) 
 

Get a character by name.

Returns:
the character if found, NULL otherwise.

Definition at line 205 of file account.cpp.

Characters & Account::getCharacters  ) 
 

Get all the characters.

Returns:
all the characters.

Definition at line 196 of file account.cpp.

const std::string & Account::getEmail void   )  const
 

Get the user email address.

Returns:
the user email address.

Definition at line 130 of file account.cpp.

int Account::getID  )  const [inline]
 

Get account ID.

Returns:
the unique ID of the account, a negative number if none yet.

Definition at line 202 of file account.hpp.

AccountLevel Account::getLevel  )  const
 

Get the account level.

Returns:
the account level.

Definition at line 150 of file account.cpp.

const std::string & Account::getName  )  const
 

Get the user name.

Returns:
the user name.

Definition at line 89 of file account.cpp.

const std::string Account::getPassword void   )  const
 

Get the user password.

Returns:
the user password.

Definition at line 109 of file account.cpp.

Account& Account::operator= Account const &  rhs  )  [private]
 

void Account::setCharacters const Characters characters  ) 
 

Set the characters.

Parameters:
characters a list of characters.

Definition at line 160 of file account.cpp.

void Account::setEmail const std::string &  email  ) 
 

Set the user email address.

Parameters:
email the user email address.

Definition at line 119 of file account.cpp.

void Account::setID int   ) 
 

Set account ID.

The account shall not have any ID yet.

Definition at line 216 of file account.cpp.

void Account::setLevel AccountLevel  level  ) 
 

Set the account level.

Parameters:
level the new level.

Definition at line 140 of file account.cpp.

void Account::setName const std::string &  name  ) 
 

Set the user name.

Parameters:
name the user name.

Definition at line 79 of file account.cpp.

void Account::setPassword const std::string &  password  ) 
 

Set the user password.

Parameters:
password the user password.

Definition at line 99 of file account.cpp.


Member Data Documentation

Characters Account::mCharacters [private]
 

Character data.

Definition at line 222 of file account.hpp.

std::string Account::mEmail [private]
 

user email address

Definition at line 221 of file account.hpp.

int Account::mID [private]
 

unique id

Definition at line 218 of file account.hpp.

AccountLevel Account::mLevel [private]
 

account level

Definition at line 223 of file account.hpp.

std::string Account::mName [private]
 

user name

Definition at line 219 of file account.hpp.

std::string Account::mPassword [private]
 

user password (encrypted)

Definition at line 220 of file account.hpp.


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 15:39:17 2007 for TMW Server by  doxygen 1.3.9.1