YAPOG  0.0.1
Yet Another Pokemon Online Game
TypeInfo.cpp
Go to the documentation of this file.
2 
3 namespace yap
4 {
6 
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 
22  : staticID_ (copy.staticID_)
23  , name_ (copy.name_)
24  , typeEffect_ (copy.typeEffect_)
25  {
26  }
27 
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
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