OSDN Git Service

[Modify] boostライブラリに依存した処理をコメントアウトによる一時的措置を含めて完了.
[deeangband/Deeangband-new.git] / Deeangband / Item.cpp
1 /*!
2  * @file Item.cpp
3  * @brief \83Q\81[\83\80\92\86\82Ì\83N\83\8a\81[\83`\83\83\81[\82ð\92è\8b`\82·\82é
4  * @date 2013/12/11
5  * @author Deskull
6  * 2013 Sikabane Works.
7  */
8
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, std::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 bool Item::addOneSustain(bool allowDuplicating)
52 {
53         // @todo: Item::addOneSustain\82ð\8eÀ\91\95\81B
54         return false;
55 }
56
57
58 void Item::XMLSave(std::string filename)
59 {
60         Item item = *this;
61         std::ofstream ofs(filename);
62         assert(ofs);
63         //boost::archive::xml_oarchive oa(ofs);
64         //oa << BOOST_SERIALIZATION_NVP(item);
65 }
66
67 }