YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
TypeInfo.cpp
Go to the documentation of this file.
1
# include "
YAPOG/Game/Pokemon/TypeInfo.hpp
"
2
3
namespace
yap
4
{
5
const
float
TypeInfo::DEFAULT_FACTOR_EFFECT_VALUE
= 1.f;
6
7
TypeInfo::TypeInfo
()
8
: staticID_ (0)
9
, name_ ()
10
, typeEffect_ ()
11
{
12
}
13
14
TypeInfo::TypeInfo
(
const
ID
&
id
)
15
: staticID_ (id)
16
, name_ ()
17
, typeEffect_ ()
18
{
19
}
20
21
TypeInfo::TypeInfo
(
const
TypeInfo
& copy)
22
: staticID_ (copy.staticID_)
23
, name_ (copy.name_)
24
, typeEffect_ (copy.typeEffect_)
25
{
26
}
27
28
TypeInfo
*
TypeInfo::Clone
()
const
29
{
30
return
new
TypeInfo
(*
this
);
31
}
32
34
const
ID
&
TypeInfo::GetID
()
const
35
{
36
return
staticID_
;
37
}
38
39
const
String
&
TypeInfo::GetName
()
const
40
{
41
return
name_
;
42
}
43
44
const
float
&
TypeInfo::GetTypeEffect
(
const
ID
& typeID)
const
45
{
46
if
(
typeEffect_
.
Contains
(typeID))
47
return
typeEffect_
[typeID];
48
else
49
return
DEFAULT_FACTOR_EFFECT_VALUE
;
50
}
51
53
void
TypeInfo::SetID
(
const
ID
&
id
)
54
{
55
staticID_
= id;
56
}
57
58
void
TypeInfo::SetName
(
const
String
& name)
59
{
60
name_
= name;
61
}
62
63
void
TypeInfo::AddTypeEffect
(
const
ID
& typeID,
const
float
& effect)
64
{
65
typeEffect_
.
Add
(typeID, effect);
66
}
67
68
bool
TypeInfo::operator==
(
const
TypeInfo
& right)
const
69
{
70
return
staticID_
== right.
GetID
();
71
}
72
73
74
}
// namespace yap
YAPOG
src
YAPOG
Game
Pokemon
TypeInfo.cpp
Generated on Mon Sep 17 2012 22:24:25 for YAPOG by
1.8.1.1