OSDN Git Service

Implement GameWorld::GenerateCreature().
authorDeskull <desull@users.sourceforge.jp>
Mon, 23 Jun 2014 11:17:18 +0000 (20:17 +0900)
committerDeskull <desull@users.sourceforge.jp>
Mon, 23 Jun 2014 11:17:18 +0000 (20:17 +0900)
Deeangband/GameWorld.cpp
Deeangband/GameWorld.h

index d6ea4ec..8ec2e62 100644 (file)
@@ -42,7 +42,12 @@ namespace Deeangband
 
        bool GameWorld::GenerateCreature(TAG creatureTag)
        {
-               creatureList.emplace(0, boost::make_shared<Creature>(speciesList.find(creatureTag)));
+               creatureList.emplace(this->creatureID, boost::make_shared<Creature>(speciesList.find(creatureTag)));
+               actionList.push_back(creatureList[this->creatureID]);
+               do
+               {
+                       this->creatureID++;
+               } while(creatureList.find(this->creatureID) != creatureList.end());
                return true;
        }
 
@@ -616,7 +621,7 @@ namespace Deeangband
                return this->playerPtr;
        }
 
-       std::vector<HaveGameTime>* GameWorld::GetActionList(void)
+       std::vector<boost::shared_ptr<HaveGameTime>>* GameWorld::GetActionList(void)
        {
                return &(this->actionList);
        }
index 175e943..1416d3c 100644 (file)
@@ -86,7 +86,7 @@ namespace Deeangband
                ID fieldID;    //!<\8bó\82«\83t\83B\81[\83\8b\83hID
                ID trapID;     //!<\8bó\82«\83g\83\89\83b\83vID
 
-               std::vector<HaveGameTime> actionList; /*!<\8ds\93®\8f\87\83\8a\83X\83g*/
+               std::vector<boost::shared_ptr<HaveGameTime>> actionList; /*!<\8ds\93®\8f\87\83\8a\83X\83g*/
 
                Creature *playerPtr; //!< \83v\83\8c\83C\83\84\81[\83N\83\8a\81[\83`\83\83\81[\8eQ\8fÆ\83|\83C\83\93\83^
                GAME_TIME gameTime; //!<\83Q\81[\83\80\8e\9e\8aÔ
@@ -495,7 +495,7 @@ namespace Deeangband
                 * @brief \8ds\93®\8f\87\83\8a\83X\83g\82ð\95Ô\82·
                 * @return \8ds\93®\8f\87\83\8a\83X\83g
                 */
-               std::vector<HaveGameTime>* GetActionList(void);
+               std::vector<boost::shared_ptr<HaveGameTime>>* GetActionList(void);
 
        };