account.hpp

Go to the documentation of this file.
00001 /*
00002  *  The Mana World Server
00003  *  Copyright 2004 The Mana World Development Team
00004  *
00005  *  This file is part of The Mana World.
00006  *
00007  *  The Mana World  is free software; you can redistribute  it and/or modify it
00008  *  under the terms of the GNU General  Public License as published by the Free
00009  *  Software Foundation; either version 2 of the License, or any later version.
00010  *
00011  *  The Mana  World is  distributed in  the hope  that it  will be  useful, but
00012  *  WITHOUT ANY WARRANTY; without even  the implied warranty of MERCHANTABILITY
00013  *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
00014  *  more details.
00015  *
00016  *  You should  have received a  copy of the  GNU General Public  License along
00017  *  with The Mana  World; if not, write to the  Free Software Foundation, Inc.,
00018  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00019  *
00020  *  $Id: account.hpp 3167 2007-03-05 03:32:59Z rogier_polak $
00021  */
00022 
00023 #ifndef _TMWSERV_ACCOUNT_H_
00024 #define _TMWSERV_ACCOUNT_H_
00025 
00026 #include <string>
00027 
00028 #include "defines.h"
00029 #include "account-server/characterdata.hpp"
00030 #include "utils/countedptr.h"
00031 
00047 class Account
00048 {
00049     public:
00057         Account(const std::string& name,
00058                 const std::string& password,
00059                 const std::string& email,
00060                 int id = -1);
00061 
00062 
00071         Account(const std::string& name,
00072                 const std::string& password,
00073                 const std::string& email,
00074                 const Characters& characters);
00075 
00076 
00080         ~Account();
00081 
00082 
00088         void
00089         setName(const std::string& name);
00090 
00091 
00097         const std::string&
00098         getName() const;
00099 
00100 
00106         void
00107         setPassword(const std::string& password);
00108 
00109 
00115         const std::string
00116         getPassword(void) const;
00117 
00118 
00124         void
00125         setEmail(const std::string& email);
00126 
00127 
00133         const std::string&
00134         getEmail(void) const;
00135 
00136 
00142         void
00143         setLevel(AccountLevel level);
00144 
00145 
00151         AccountLevel
00152         getLevel() const;
00153 
00154 
00160         void
00161         setCharacters(const Characters& characters);
00162 
00163 
00169         void
00170         addCharacter(CharacterPtr character);
00171 
00177         bool
00178         delCharacter(std::string const &name);
00179 
00180 
00186         Characters&
00187         getCharacters();
00188 
00194         CharacterPtr
00195         getCharacter(const std::string& name);
00196 
00202          int getID() const
00203          { return mID; }
00204 
00209          void setID(int);
00210 
00211     private:
00212         Account();
00213         Account(Account const &rhs);
00214         Account &operator=(Account const &rhs);
00215 
00216 
00217     private:
00218         int mID;               
00219         std::string mName;     
00220         std::string mPassword; 
00221         std::string mEmail;    
00222         Characters mCharacters;   
00223         AccountLevel mLevel;   
00224 };
00225 
00226 
00230 typedef utils::CountedPtr<Account> AccountPtr;
00231 
00232 
00233 #endif // _TMWSERV_ACCOUNT_H_

Generated on Fri Mar 30 15:39:15 2007 for TMW Server by  doxygen 1.3.9.1