OSDN Git Service

GameWorld::GenerateCreature() の引数修正。 / Fix arguments of GameWorld::GenerateCreature().
authorDeskull <desull@users.sourceforge.jp>
Fri, 9 Jan 2015 13:02:21 +0000 (22:02 +0900)
committerDeskull <desull@users.sourceforge.jp>
Fri, 9 Jan 2015 13:02:21 +0000 (22:02 +0900)
Deeangband/GameWorld.cpp
Deeangband/GameWorld.h

index 6cf01fe..4ad09a6 100644 (file)
@@ -53,6 +53,7 @@ namespace Deeangband
                Dice::Initialize();
                XMLLoad();
                std::map<ID, boost::shared_ptr<Field>>::iterator fieldIt;
+               std::map<TAG, boost::shared_ptr<Species>>::iterator speciesIt;
 
                this->itemID = 0;
                this->trapID = 0;
@@ -63,15 +64,11 @@ namespace Deeangband
                fieldList.emplace(0, boost::make_shared<Field>(dungeonList.find("VANILLA_WOMB"), 1));
                fieldIt = fieldList.find(0);
 
-               GameWorld::GenerateCreature("VANILLA_STIGMATIC", 0, 10, 10);
-               GameWorld::GenerateCreature("VANILLA_RAVING_LUNATIC", 0, 5, 5);
-
-               /*
-               speciesIt = SpeciesList.find("VANILLA_STIGMATIC");
+               speciesIt = speciesList.find("VANILLA_STIGMATIC");
                GameWorld::GenerateCreature(speciesIt, fieldIt, 10, 10);
-               speciesIt = SpeciesList.find("VANILLA_RAVING_LUNATIC");
+
+               speciesIt = speciesList.find("VANILLA_RAVING_LUNATIC");
                GameWorld::GenerateCreature(speciesIt, fieldIt, 5, 5);
-               */
 
 
                for(i = 0; i < MAX_KARMAS; i++)
@@ -86,10 +83,9 @@ namespace Deeangband
        {
        }
 
-       bool GameWorld::GenerateCreature(TAG creatureTag)
+       bool GameWorld::GenerateCreature(std::map<TAG, boost::shared_ptr<Species>>::iterator& speciesIt)
        {
-               creatureList.emplace(this->creatureID, boost::make_shared<Creature>(speciesList.find(creatureTag)));
-               //actionList.push_back(creatureList[this->creatureID]);
+               creatureList.emplace(this->creatureID, boost::make_shared<Creature>(speciesIt));
                do
                {
                        this->creatureID++;
@@ -97,10 +93,9 @@ namespace Deeangband
                return true;
        }
 
-       bool GameWorld::GenerateCreature(TAG creatureTag, ID fieldID, int x, int y)
+       bool GameWorld::GenerateCreature(std::map<TAG, boost::shared_ptr<Species>>::iterator& speciesIt, std::map<ID, boost::shared_ptr<Field>>::iterator& fieldIt, int x, int y)
        {
-               creatureList.emplace(this->creatureID, boost::make_shared<Creature>(speciesList.find(creatureTag), fieldID, x, y));
-               //actionList.push_back(creatureList[this->creatureID]);
+               creatureList.emplace(this->creatureID, boost::make_shared<Creature>(speciesIt, fieldIt, x, y));
                creatureList[this->creatureID]->PlusWait(100, TRUE);
                creatureList[this->creatureID]->UpdateFieldLore(this->GetField(fieldID));
                do
index 7992806..98a513d 100644 (file)
@@ -320,7 +320,7 @@ namespace Deeangband
                * @param creatureTag \83N\83\8a\81[\83`\83\83\81[\83^\83O
                * @return \90\90¬\82É\90¬\8c÷\82µ\82½\8fê\8d\87true\82ð\95Ô\82·
                */
-               bool GameWorld::GenerateCreature(TAG creatureTag);
+               bool GameWorld::GenerateCreature(std::map<TAG, boost::shared_ptr<Species>>::iterator& speciesIt);
 
                /*!
                * @brief \83N\83\8a\81[\83`\83\83\81[\82ð\90\90¬\82µGameWorld\92\86\82Ì\8f\94\97v\91f\82Æ\98A\8cg\82³\82¹\82é
@@ -330,7 +330,7 @@ namespace Deeangband
                * @param y \94z\92u\90æY\8dÀ\95W
                * @return \90\90¬\82É\90¬\8c÷\82µ\82½\8fê\8d\87true\82ð\95Ô\82·
                */
-               bool GameWorld::GenerateCreature(TAG creatureTag, ID fieldID, int x, int y);
+               bool GameWorld::GenerateCreature(std::map<TAG, boost::shared_ptr<Species>>::iterator& speciesIt, std::map<ID, boost::shared_ptr<Field>>::iterator& fieldIt, int x, int y);
 
                /*!
                * @brief GameWorld\92\86\82É\91\8dÝ\82·\82é\8c \94\\82ð\95Ô\82·