From d0b6b3d1c96e437d12410703a8e530decd0b028f Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Thu, 27 Jul 2006 17:20:22 +0000 Subject: First step toward a restructured class hierarchy for world actors: add MovingObject and Player classes. --- src/account.h | 51 ++++++++++++++------------------------------------- 1 file changed, 14 insertions(+), 37 deletions(-) (limited to 'src/account.h') diff --git a/src/account.h b/src/account.h index 2d9da17a..b1ba59d0 100644 --- a/src/account.h +++ b/src/account.h @@ -30,10 +30,6 @@ #include "being.h" -namespace tmwserv -{ - - /** * Notes: * - change from the previous implementation: this class does not encrypt @@ -76,14 +72,13 @@ class Account Account(const std::string& name, const std::string& password, const std::string& email, - const Beings& characters); + const Players& characters); /** * Destructor. */ - ~Account(void) - throw(); + ~Account(); /** @@ -101,7 +96,7 @@ class Account * @return the user name. */ const std::string& - getName(void) const; + getName() const; /** @@ -155,7 +150,7 @@ class Account * @return the account level. */ AccountLevels - getLevel(void) const; + getLevel() const; /** @@ -164,7 +159,7 @@ class Account * @param characters a list of characters. */ void - setCharacters(const Beings& characters); + setCharacters(const Players& characters); /** @@ -173,7 +168,7 @@ class Account * @param character the new character. */ void - addCharacter(BeingPtr character); + addCharacter(PlayerPtr character); /** * Remove a character. @@ -181,7 +176,7 @@ class Account * @param name The character's name to delete. */ bool - delCharacter(std::string name); + delCharacter(std::string const &name); /** @@ -189,44 +184,29 @@ class Account * * @return all the characters. */ - Beings& - getCharacters(void); + Players& + getCharacters(); /** * Get a character by name. * * @return the character if found, NULL otherwise. */ - Being* + PlayerPtr getCharacter(const std::string& name); private: - /** - * Default constructor. - */ - Account(void) - throw(); - - - /** - * Copy constructor. - */ - Account(const Account& rhs); - - - /** - * Assignment operator. - */ - Account& - operator=(const Account& rhs); + Account(); + Account(Account const &rhs); + Account &operator=(Account const &rhs); private: std::string mName; /**< user name */ std::string mPassword; /**< user password (encrypted) */ std::string mEmail; /**< user email address */ - Beings mCharacters; /**< player data */ + Players mCharacters; /**< player data */ AccountLevels mLevel; /**< account level */ }; @@ -237,7 +217,4 @@ class Account typedef utils::CountedPtr AccountPtr; -} // namespace tmwserv - - #endif // _TMWSERV_ACCOUNT_H_ -- cgit v1.2.3-60-g2f50