OSDN Git Service

GameElementにstaticなポインタ GameWorldPtr, GameSurfacePtr, GameLoggerPtrを追加。 / Add static...
authorDeskull <desull@users.sourceforge.jp>
Tue, 20 Jan 2015 14:50:22 +0000 (23:50 +0900)
committerDeskull <desull@users.sourceforge.jp>
Tue, 20 Jan 2015 14:50:22 +0000 (23:50 +0900)
Deeangband/Field.cpp
Deeangband/GameElement.cpp
Deeangband/GameElement.h
Deeangband/GameEngine.cpp
Deeangband/Square.h

index 50c8130..19bef0f 100644 (file)
@@ -30,8 +30,14 @@ namespace Deeangband
                        for(x = 0; x < width; x++)
                        {
                                squares[y].push_back(boost::shared_ptr<Square>(new Square()));
-                               if(Dice::Cast(1, 4) == 3) squares[y][x]->SetFloorTag(dungeonPtr->GetInnerWallFloorTag());
-                               else squares[y][x]->SetFloorTag(dungeonPtr->GetFloorFloorTag());
+                               if(Dice::Cast(1, 4) == 3)
+                               {
+                                       squares[y][x]->SetFloorTag(dungeonPtr->GetInnerWallFloorTag());
+                               }
+                               else
+                               {
+                                       squares[y][x]->SetFloorTag(dungeonPtr->GetFloorFloorTag());
+                               }
                        }
                }
 
index 1294749..cd284c7 100644 (file)
@@ -9,9 +9,15 @@
 #include "stdafx.h"
 #include "GameElement.h"
 #include "GameWorld.h"
+#include "GameSurface.h"
+#include "GameLogger.h"
 
 namespace Deeangband
 {
+       GameWorld *GameElement::GameWorldPtr;
+       GameSurface *GameElement::GameSurfacePtr;
+       GameLogger *GameElement::GameLoggerPtr;
+
        GameElement::GameElement(void)
        {
                this->WipeData();
index 58111d3..b551f59 100644 (file)
@@ -13,6 +13,8 @@
 namespace Deeangband
 {
        class GameWorld;
+       class GameSurface;
+       class GameLogger;
 
        /*! 
         * @class GameElement
@@ -49,6 +51,10 @@ namespace Deeangband
 
        public:
 
+               static GameWorld *GameWorldPtr;
+               static GameSurface *GameSurfacePtr;
+               static GameLogger *GameLoggerPtr;
+
                /*! 
                * @brief \92·\82³\82ð\92P\88Ê\82Â\82«\82Åstring\82É\95Ï\8a·\82·\82é\81B
                */
index 88c7e4f..c373c92 100644 (file)
@@ -24,6 +24,10 @@ namespace Deeangband
                gameSurface = new GameSurfaceSDL(gameWorld);
                gameLogger = new GameLogger();
 
+               GameElement::GameWorldPtr = gameWorld;
+               GameElement::GameSurfacePtr = gameSurface;
+               GameElement::GameLoggerPtr = gameLogger;
+
                gameSurface->SetField(gameWorld->GetField(0));
                gameSurface->SetSideStatusCreature(gameWorld->GetCreature(0));
                this->gameLogger->PutLog("GameEngine\8aJ\8en");
index 282601b..81b17d1 100644 (file)
@@ -60,8 +60,8 @@ namespace Deeangband
                void Square::WipeData(void);
 
                /*!
-                * @brief \8f\8a\91®\82·\82é\83t\83\8d\83A\82Ì\83|\83C\83\93\83^\82ð\95Ô\82·\81B
-                */
+               * @brief \8f\8a\91®\82·\82é\83t\83\8d\83A\82Ì\83|\83C\83\93\83^\82ð\95Ô\82·\81B
+               */
                Field* Square::GetFieldPtr(void);
 
                /*!