diff options
Diffstat (limited to 'src/account.cpp')
-rw-r--r-- | src/account.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/account.cpp b/src/account.cpp index a72068b8..d9d8ba0f 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -55,18 +55,36 @@ const std::string& Account::getEmail() return email; } -void Account::setName(const std::string &n) +Being* Account::getCharacter(const std::string &name) { - name = n; + for (unsigned int i = 0; i < beings.size(); i++) + { + if (beings[i]->getName() == name) + { + return beings[i]; + } + } + + return NULL; +} + +void Account::setName(const std::string &name) +{ + this->name = name; } -void Account::setPassword(const std::string &p) +void Account::setPassword(const std::string &password) { // A hash of p needs to be made then hash stored in password - password = p; + this->password = password; +} + +void Account::setEmail(const std::string &email) +{ + this->email = email; } -void Account::setEmail(const std::string &e) +void Account::setCharacters(const std::vector<Being*> &beings) { - email = e; + this->beings = beings; } |