D'angband  0.0.0
Deeangband
 全て クラス 名前空間 ファイル 関数 変数 型定義 列挙型 列挙値 フレンド マクロ定義 ページ
HaveHp.cpp
[詳解]
1 
9 #include "stdafx.h"
10 #include "HaveHp.h"
11 
12 namespace Deeangband
13 {
14  HaveHp::HaveHp(void)
15  {
16  return;
17  }
18 
19  HaveHp::‾HaveHp(void)
20  {
21  return;
22  }
23 
24  HP HaveHp::GetCurHP(void)
25  {
26  return this->currentHp;
27  }
28 
29  HP HaveHp::GetMaxHP(void)
30  {
31  return this->maxHp;
32  }
33 
34  HP HaveHp::GetNorMaxHP(void)
35  {
36  return this->maxMaxHp;
37  }
38 
39  void HaveHp::CalcHP(HP amount)
40  {
41  this->currentHp += amount;
42  if(this->currentHp < 0) this->currentHp = 0;
43  if(this->currentHp > this->maxHp) this->currentHp = this->maxHp;
44  }
45 
46  void HaveHp::SetHP(HP amount)
47  {
48  this->currentHp = amount;
49  if(this->currentHp < 0) this->currentHp = 0;
50  if(this->currentHp > this->maxHp) this->currentHp = this->maxHp;
51  }
52 
53  void HaveHp::CalcMaxHP(HP amount)
54  {
55  this->maxHp += amount;
56  if(this->maxHp < 0) this->maxHp = 0;
57  if(this->maxHp > this->maxMaxHp) this->maxHp = this->maxMaxHp;
58  }
59 
60  void HaveHp::SetMaxHP(HP amount)
61  {
62  this->maxHp = amount;
63  if(this->maxHp < 0) this->maxHp = 0;
64  if(this->maxHp > this->maxMaxHp) this->maxHp = this->maxMaxHp;
65  }
66 
67  void HaveHp::CalcMaxMaxHP(HP amount)
68  {
69  this->maxMaxHp += amount;
70  if(this->maxMaxHp < 0) this->maxMaxHp = 0;
71  }
72 
73  void HaveHp::SetMaxMaxHP(HP amount)
74  {
75  this->maxMaxHp = amount;
76  if(this->maxMaxHp < 0) this->maxMaxHp = 0;
77  }
78 
79 }
HP currentHp
現在のHP
Definition: HaveHp.h:42
HP保持抽象クラスのプロトタイプ宣言
HP maxHp
現在の最大HP
Definition: HaveHp.h:43
標準のシステム インクルード ファイルのインクルード ファイル、または 参照回数が多く、かつあまり変更さ...
HP maxMaxHp
平常の最大HP
Definition: HaveHp.h:44
int HP
HPの変数型
Definition: Deeangband.h:135