OSDN Git Service

Move Creature::itemList to HaveInventory::itemList.
authorDeskull <desull@users.sourceforge.jp>
Wed, 18 Jun 2014 11:50:38 +0000 (20:50 +0900)
committerDeskull <desull@users.sourceforge.jp>
Wed, 18 Jun 2014 11:50:38 +0000 (20:50 +0900)
Deeangband/Creature.cpp
Deeangband/Creature.h
Deeangband/HaveInventory.cpp
Deeangband/HaveInventory.h
Deeangband/Square.h

index 476d5e2..4adde41 100644 (file)
@@ -137,7 +137,6 @@ namespace Deeangband
                this->floorID = -1;
                this->position.Set(0, 0);
 
-               this->itemList.clear();
                this->skillExpList.clear();
 
                this->symbol = '@';
index 272229f..9b5ae7f 100644 (file)
@@ -16,6 +16,7 @@
 #include "Direction.h"
 #include "Effect.h"
 #include "Floor.h"
+#include "HaveInventory.h"
 #include "HaveGameTime.h"
 #include "HaveHp.h"
 #include "HaveSymbol.h"
@@ -62,7 +63,7 @@ namespace Deeangband
        * <li>\8f\8a\8e\9d\83X\83L\83\8b\88ê\97\97 / Current Pisition</li>
        * </ul>
        */
-       class Creature : public GameInstance, public HaveSymbol, public HaveHp, public HaveGameTime, public HavePosition
+       class Creature : public GameInstance, public HaveSymbol, public HaveHp, public HaveGameTime, public HavePosition, public HaveInventory
        {
        private:
 
@@ -92,7 +93,6 @@ namespace Deeangband
 
                SavingTable savings; //!< \83Z\81[\83r\83\93\83O
 
-               std::vector<Item> itemList;  //!< \8f\8a\8e\9d\83A\83C\83e\83\80\83\8a\83X\83g
                std::map<TAG, SKILL_EXP> skillExpList; //!< \83X\83L\83\8b\8co\8c±\92l\83\8a\83X\83g
 
                ID campID; //!< \8f\8a\91®\90w\89cID
index 356753d..e95be3a 100644 (file)
@@ -24,6 +24,7 @@ namespace Deeangband
 
        void HaveInventory::WipeData(void)
        {
+               this->itemList.clear();
        }
 
 }
\ No newline at end of file
index 964d041..505d2e5 100644 (file)
@@ -11,6 +11,7 @@
 #include "stdafx.h"
 #include "Deeangband.h"
 #include "GameElement.h"
+#include "Item.h"
 
 namespace Deeangband
 {
@@ -26,7 +27,6 @@ namespace Deeangband
 
                friend class boost::serialization::access;
 
-
                /*!
                * @brief \83N\83\89\83X\82Ì\83V\83\8a\83A\83\89\83C\83Y\82ð\90Ý\92è\82·\82é
                * @param archive \83A\81[\83J\83C\83u\89»\82·\82é\83N\83\89\83X\82Ì\83A\83h\83\8c\83X
@@ -40,6 +40,9 @@ namespace Deeangband
                        }
                }
 
+       protected:
+               std::vector<Item> itemList;  //!< \83A\83C\83e\83\80\83\8a\83X\83g
+
        public:
 
                /*! 
index 926f600..43d0346 100644 (file)
@@ -11,6 +11,8 @@
 #include "stdafx.h"
 #include "Deeangband.h"
 #include "GameElement.h"
+#include "HaveHp.h"
+#include "HaveInventory.h"
 
 namespace Deeangband
 {
@@ -19,7 +21,7 @@ namespace Deeangband
        * @class Square
        * @brief \83}\83X\82Ì\83N\83\89\83X
        */
-       class Square : public GameElement
+       class Square : public GameElement, public HaveInventory, public HaveHp
        {
        private:
                TAG featureTag;   //!<\92n\8c`\83^\83O