00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _TMWSERV_ACCOUNT_H_
00022 #define _TMWSERV_ACCOUNT_H_
00023
00024 #include <string>
00025 #include <vector>
00026 #include <time.h>
00027
00028 #include "account-server/character.hpp"
00029
00034 class Account
00035 {
00036 public:
00040 Account(int id = -1): mID(id)
00041 {}
00042
00046 ~Account();
00047
00048
00054 void setName(const std::string &name)
00055 { mName = name; }
00056
00057
00063 const std::string &getName() const
00064 { return mName; }
00065
00066
00077 void setPassword(const std::string &password)
00078 { mPassword = password; }
00079
00080
00086 const std::string &getPassword() const
00087 { return mPassword; }
00088
00089
00096 void setEmail(const std::string &email)
00097 { mEmail = email; }
00098
00099
00105 const std::string &getEmail() const
00106 { return mEmail; }
00107
00108
00114 void setLevel(int level)
00115 { mLevel = level; }
00116
00117
00123 int getLevel() const
00124 { return mLevel; }
00125
00126
00132 void
00133 setCharacters(const Characters& characters);
00134
00135
00141 void addCharacter(Character *character);
00142
00148 void delCharacter(int i);
00149
00150
00156 Characters &getCharacters()
00157 { return mCharacters; }
00158
00164 const Characters &getCharacters() const
00165 { return mCharacters; }
00166
00172 int getID() const
00173 { return mID; }
00174
00179 void setID(int);
00180
00184 time_t getRegistrationDate() const
00185 { return mRegistrationDate; }
00186
00192 void setRegistrationDate(time_t time);
00193
00197 time_t getLastLogin() const
00198 { return mLastLogin; }
00199
00205 void setLastLogin(time_t time);
00206
00207 private:
00208 Account(const Account &rhs);
00209 Account &operator=(const Account &rhs);
00210
00211 std::string mName;
00212 std::string mPassword;
00213 std::string mEmail;
00214 Characters mCharacters;
00215 int mID;
00216 unsigned char mLevel;
00217 time_t mRegistrationDate;
00218 time_t mLastLogin;
00219 };
00220
00221 typedef std::vector< Account * > Accounts;
00222
00223 #endif // _TMWSERV_ACCOUNT_H_