YAPOG  0.0.1
Yet Another Pokemon Online Game
AccountTable.cpp
Go to the documentation of this file.
2 #include "Account/Account.hpp"
3 
4 namespace yse
5 {
7  : id_ (Account::DEFAULT_ACCOUNT_ID)
8  , name_ (Account::DEFAULT_ACCOUNT_NAME)
9  , password_ (Account::DEFAULT_ACCOUNT_PASSWORD)
10  , email_ (Account::DEFAULT_ACCOUNT_EMAIL)
11  , creationDate_ (Account::DEFAULT_ACCOUNT_CREATION_DATE)
12  , permissions_ (Account::DEFAULT_ACCOUNT_PERMISSION)
13  , lastLoginDate_ (Account::DEFAULT_ACCOUNT_LAST_LOGIN_DATE)
14  , creationIP_ (Account::DEFAULT_ACCOUNT_CREATION_IP)
15  , currentIP_ (Account::DEFAULT_ACCOUNT_CURRENT_IP)
16  {
17  }
18 
19  void AccountTable::LoadFromAccount (const Account& account)
20  {
21  SetID (account.GetID ());
22  SetName (account.GetName ());
23  SetPassword (account.GetPassword ());
24  SetEmail (account.GetEmail ());
25  SetPermissions (account.GetPermissions ());
26  SetCreationDate (account.GetCreationDate ());
28  SetCreationIP (account.GetCreationIP ());
29  SetCurrentIP (account.GetCurrentIP ());
30  }
31 
33  const yap::ID& AccountTable::GetID () const
34  { return id_; }
36  { return name_; }
38  { return password_; }
40  { return email_; }
42  { return permissions_; }
44  { return creationDate_; }
46  { return lastLoginDate_; }
48  { return creationIP_; }
50  { return currentIP_; }
51 
53  void AccountTable::SetID (const yap::ID& value)
54  { id_ = value; }
55  void AccountTable::SetName (const yap::String& value)
56  { name_ = value; }
58  { password_ = value; }
59  void AccountTable::SetEmail (const yap::String& value)
60  { email_ = value; }
62  { permissions_ = value; }
64  { creationDate_ = value; }
66  { lastLoginDate_ = value; }
68  { creationIP_ = value; }
70  { currentIP_ = value; }
71 
73  {
74  std::cout << "ID: " << id_.GetValue () << std::endl
75  << "Username: " << name_ << std::endl
76  << "Password: " << password_ << std::endl
77  << "Email: " << email_ << std::endl
78  << "Permission: "
79  << static_cast<yap::UInt16> (permissions_) << std::endl
80  << "Creation Date: " << creationDate_ << std::endl
81  << "Last Login Date: " << lastLoginDate_ << std::endl
82  << "Creation IP: " << creationIP_ << std::endl
83  << "Current IP: " << currentIP_ << std::endl;
84  }
85 
86 } // namespace yse