OSDN Git Service

ゲーム時間経過処理を実装中 / Implementing game time processing.
[deeangband/Deeangband-new.git] / Deeangband / HavePosition.cpp
index f6237fe..8b3f5dc 100644 (file)
@@ -24,17 +24,18 @@ namespace Deeangband
                return;
        }
 
-       HavePosition::HavePosition(Coordinates *coordinates)
+       HavePosition::HavePosition(MAP_LENGTH x, MAP_LENGTH y)
        {
-               this->position = *coordinates;
-               this->fieldID = 0;
+               WipeData();
+               this->position.Set(x, y);
                return;
        }
 
-       HavePosition::HavePosition(int x, int y)
+       HavePosition::HavePosition(std::map<ID, boost::shared_ptr<Field>>::iterator fieldIt, MAP_LENGTH x, MAP_LENGTH y)
        {
                this->position.Set(x, y);
-               this->fieldID = 0;
+               this->fieldID = fieldIt->first;
+               this->fieldPtr =  fieldIt->second;
                return;
        }
 
@@ -42,6 +43,7 @@ namespace Deeangband
        {
                this->position.Set(0, 0);
                this->fieldID = 0;
+               this->fieldPtr = NULL;
        }
 
        Coordinates HavePosition::GetPosition(void)