YAPOG  0.0.1
Yet Another Pokemon Online Game
PokemonStat.cpp
Go to the documentation of this file.
3 
4 namespace yap
5 {
7  {
8  }
9 
11  const HitPoint& hp,
12  const Attack& atk,
13  const Defense& def,
14  const SpecialAttack& speAtk,
15  const SpecialDefense& speDef,
16  const Speed& speed)
17  : hitPoint_ (hp)
18  , attack_ (atk)
19  , defense_ (def)
20  , specialAttack_ (speAtk)
21  , specialDefense_ (speDef)
22  , speed_ (speed)
23  {
24  }
25 
27  : hitPoint_ (copy.GetHitPoint ())
28  , attack_ (copy.GetAttack ())
29  , defense_ (copy.GetDefense ())
30  , specialAttack_ (copy.GetSpecialAttack ())
31  , specialDefense_ (copy.GetSpecialDefense ())
32  , speed_ (copy.GetSpeed ())
33  {
34  }
35 
37  { return hitPoint_; }
38 
40  { return attack_; }
41 
43  { return defense_; }
44 
46  { return specialAttack_; }
47 
49  { return specialDefense_; }
50 
51  const Speed& PokemonStat::GetSpeed () const
52  { return speed_; }
53 
55  { hitPoint_.SetCurrentValue (value); }
56 
58  {
59  hitPoint_ = stats.GetHitPoint ();
60  attack_ = stats.GetAttack ();
61  defense_ = stats.GetDefense ();
64  speed_ = stats.GetSpeed ();
65  }
66 
67  void PokemonStat::ModifyHitPoint (int value)
68  {
69  hitPoint_.AddValue (value);
70  }
71 
73  const PokemonInfo& pokeInfo,
74  const UInt16& level,
75  const NatureInfo& natureInfo)
76  {
77  hitPoint_.ComputeValue (pokeInfo.GetHitPoint (), level);
78 
81 
83  pokeInfo.GetAttack (),
84  level,
85  natureInfo.GetAttackFactor ());
86 
88  pokeInfo.GetDefense (),
89  level,
90  natureInfo.GetDefenseFactor ());
91 
93  pokeInfo.GetSpecialAttack (),
94  level,
95  natureInfo.GetSpecialAttackFactor ());
96 
98  pokeInfo.GetSpecialDefense (),
99  level,
100  natureInfo.GetSpecialDefenseFactor ());
101 
103  pokeInfo.GetSpeed (),
104  level,
105  natureInfo.GetSpeedFactor ());
106  }
107 
109  {
110  hitPoint_.Restore ();
111  }
112 
113 } // namespace yap