D'angband  0.0.0
Deeangband
 全て クラス 名前空間 ファイル 関数 変数 型定義 列挙型 列挙値 フレンド マクロ定義 ページ
Item.cpp
[詳解]
1 
9 #include "stdafx.h"
10 #include "Item.h"
11 
12 namespace Deeangband
13 {
14 
15 Item::Item(void) : ItemTemplate(), GameInstance(), HaveGameTime(), HavePosition()
16 {
17  this->WipeData();
18 }
19 
20 
21 Item::Item(std::map<TAG, boost::shared_ptr<ItemBase>>::iterator itemBaseIt) : ItemTemplate(), GameInstance(), HaveGameTime(), HavePosition()
22 {
23  this->WipeData();
24  this->weight = itemBaseIt->second->GetWeight();
25  this->baseDamage = itemBaseIt->second->GetBaseDamage();
26  this->baseSaving = itemBaseIt->second->GetBaseSaving();
27  this->baseSaving = itemBaseIt->second->GetPlusSaving();
28 }
29 
30 Item::‾Item(void)
31 {
32  this->WipeData();
33 }
34 
35 void Item::WipeData(void)
36 {
37  this->weight = 0;
38  this->baseDamage.Set(0, 0);
39  this->baseSaving.Set(0, 0, 0);
40 }
41 
42 bool Item::TakeEffect(Effect *effectPtr, POWER amount)
43 {
44  if(effectPtr)
45  {
46  amount = 0;
47  }
48  return true;
49 }
50 
51 void Item::XMLSave(std::string filename)
52 {
53  Item item = *this;
54  std::ofstream ofs(filename);
55  assert(ofs);
56  boost::archive::xml_oarchive oa(ofs);
57  oa << BOOST_SERIALIZATION_NVP(item);
58 }
59 
60 }
int POWER
効力
Definition: Deeangband.h:155
Dice baseDamage
ベースダメージのダイス
Definition: Item.h:37
ゲーム中のアイテムと付随要素のプロトタイプ
std::string TAG
ゲーム要素文字列ID
Definition: Deeangband.h:144
標準のシステム インクルード ファイルのインクルード ファイル、または 参照回数が多く、かつあまり変更さ...
SavingTable baseSaving
基本セービング修正
Definition: Item.h:39
WEIGHT weight
アイテムの重量
Definition: Item.h:38