YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PlayerDataTable.cpp
Go to the documentation of this file.
1
#include "
Database/Tables/PlayerDataTable.hpp
"
2
#include "
Account/PlayerData.hpp
"
3
#include "
YAPOG/System/StringHelper.hpp
"
4
5
namespace
yse
6
{
7
PlayerDataTable::PlayerDataTable
(
const
yap::ID
& accountID)
8
: accountID_ (accountID)
9
, position_ (
PlayerData
::
DEFAULT_POSITION
)
10
, mapID_ (
PlayerData
::DEFAULT_MAP_ID)
11
, playTime_ (0)
12
, stepCount_ (0)
13
, respawnSpot_ (
PlayerData
::DEFAULT_RESPAWN_SPOT)
14
, fleeCount_ (0)
15
, boxNumber_ (
PlayerData
::DEFAULT_BOX_NUMBER)
16
, battleCount_ (0)
17
, money_ (
PlayerData
::DEFAULT_MONEY)
18
{
19
}
20
21
void
PlayerDataTable::LoadFromPlayerData
(
const
PlayerData
& playerData)
22
{
23
SetAccountID
(playerData.
GetAccountID
());
24
SetPosition
(playerData.
GetPosition
());
25
SetMapID
(playerData.
GetMapID
());
26
SetPlayTime
(playerData.
GetPlayTime
().
GetValue
());
27
SetStepCount
(playerData.
GetStepCount
());
28
SetRespawnSpot
(playerData.
GetRespawnSpot
());
29
SetFleeCount
(playerData.
GetFleeCount
());
30
SetBoxNumber
(playerData.
GetBoxNumber
());
31
SetBattleCount
(playerData.
GetBattleCount
());
32
SetMoney
(playerData.
GetMoney
());
33
}
34
36
const
yap::ID
&
PlayerDataTable::GetAccountID
()
const
37
{
return
accountID_
; }
38
const
yap::Vector2
&
PlayerDataTable::GetPosition
()
const
39
{
return
position_
; }
40
const
yap::ID
&
PlayerDataTable::GetMapID
()
const
41
{
return
mapID_
; }
42
int
PlayerDataTable::GetPlayTime
()
const
43
{
return
playTime_
; }
44
int
PlayerDataTable::GetStepCount
()
const
45
{
return
stepCount_
; }
46
const
yap::Vector2
&
PlayerDataTable::GetRespawnSpot
()
const
47
{
return
respawnSpot_
; }
48
int
PlayerDataTable::GetFleeCount
()
const
49
{
return
fleeCount_
; }
50
int
PlayerDataTable::GetBoxNumber
()
const
51
{
return
boxNumber_
; }
52
int
PlayerDataTable::GetBattleCount
()
const
53
{
return
battleCount_
; }
54
int
PlayerDataTable::GetMoney
()
const
55
{
return
money_
; }
56
58
void
PlayerDataTable::SetAccountID
(
const
yap::ID
& value)
59
{
accountID_
= value; }
60
void
PlayerDataTable::SetPosition
(
const
yap::Vector2
& value)
61
{
position_
= value; }
62
void
PlayerDataTable::SetMapID
(
const
yap::ID
& value)
63
{
mapID_
= value; }
64
void
PlayerDataTable::SetPlayTime
(
int
value)
65
{
playTime_
= value; }
66
void
PlayerDataTable::SetStepCount
(
int
value)
67
{
stepCount_
= value; }
68
void
PlayerDataTable::SetRespawnSpot
(
const
yap::Vector2
& value)
69
{
respawnSpot_
= value; }
70
void
PlayerDataTable::SetFleeCount
(
int
value)
71
{
fleeCount_
= value; }
72
void
PlayerDataTable::SetBoxNumber
(
int
value)
73
{
boxNumber_
= value; }
74
void
PlayerDataTable::SetBattleCount
(
int
value)
75
{
battleCount_
= value; }
76
void
PlayerDataTable::SetMoney
(
int
value)
77
{
money_
= value; }
78
79
void
PlayerDataTable::DisplayData
()
80
{
81
yap::String
position
82
(
"("
+
yap::StringHelper::ToString
(
position_
.x) +
", "
+
83
yap::StringHelper::ToString
(
position_
.y) +
")"
);
84
85
std::cout <<
"/** Player Data Information **/"
<< std::endl
86
<<
"ID: "
<<
accountID_
.
GetValue
() << std::endl
87
<<
"Position: "
<< position << std::endl
88
<<
"/****/"
<< std::endl;
89
}
90
}
// namespace yse
YAPOG.Server
src
Database
Tables
PlayerDataTable.cpp
Generated on Mon Sep 17 2012 22:24:22 for YAPOG by
1.8.1.1