OSDN Git Service

Lore::PutFieldLore() と Lore::GetFieldLore() を実装。 / Implement Lore::PutFieldLore(...
authorDeskull <desull@users.sourceforge.jp>
Sun, 4 Jan 2015 03:56:05 +0000 (12:56 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sun, 4 Jan 2015 03:56:05 +0000 (12:56 +0900)
Deeangband/Deeangband.h
Deeangband/Lore.cpp
Deeangband/Lore.h

index d00d495..f5503d5 100644 (file)
@@ -10,6 +10,8 @@
 #define CREATURE_MAX_GOLD 999999999L //!< \8dÅ\91å\83S\81[\83\8b\83h\92l
 #define CREATURE_MAX_MORTAL_LEVEL 30 //!< \92è\96½\8dÅ\91å\83\8c\83x\83\8b
 #define CREATURE_MAX_DIVINE_LEVEL 30 //!< \90_\8ai\8dÅ\91å\92l
+#define FIELD_MAX_WIDTH  65535  //!< \83t\83B\81[\83\8b\83h\8dÅ\91å\95\9d 
+#define FIELD_MAX_HEIGHT 65535  //!< \83t\83B\81[\83\8b\83h\8dÅ\91å\8d\82\82³
 #define CREATURE_MAX_LEVEL CREATURE_MAX_MORTAL_LEVEL+CREATURE_MAX_DIVINE_LEVEL //!< \90_\8ai\8d\9e\82Ý\8dÅ\91å\83\8c\83x\83\8b
 
 #define SPECIAL_NAME_UNKNOWN "UNKNOWN" //!< \96¼\8fÌ\82Ì\83_\83~\81[\96¼
index 6d7d2bc..b6ce478 100644 (file)
@@ -24,6 +24,20 @@ namespace Deeangband
 
        void Lore::WipeData(void)
        {
+               this->squareMemory.clear();
+       }
+
+       void Lore::PutFieldLore(ID floorID, int x, int y)
+       {
+               this->squareMemory[floorID][y][x] = 100;
+       }
+
+       int Lore::GetFieldLore(ID floorID, int x, int y)
+       {
+               if(this->squareMemory.find(floorID) == this->squareMemory.end()) return 0;
+               if(this->squareMemory[floorID].find(y) == this->squareMemory[floorID].end()) return 0;
+               if(this->squareMemory[floorID][y].find(x) == this->squareMemory[floorID][y].end()) return 0;
+               return this->squareMemory[floorID][y][x];
        }
 
 }
\ No newline at end of file
index b59f31b..37ef3ca 100644 (file)
@@ -13,7 +13,6 @@
 
 namespace Deeangband
 {
-
        /*! 
         * @class Lore
         * @brief \8bL\89¯\8fî\95ñ\82Ì\83N\83\89\83X
@@ -42,6 +41,8 @@ namespace Deeangband
                        }
                }
 
+               std::map<ID, std::map<int, std::map<int, int>>> squareMemory;
+
        public:
 
                /*! 
@@ -60,6 +61,25 @@ namespace Deeangband
                 */
                void Lore::WipeData(void);
 
+               /*!
+                * @brief \83t\83B\81[\83\8b\83h\8bL\89¯\82ð\92Ç\89Á\82·\82é\81B
+                * @param floorID \8bL\89¯\82·\82é\83t\83\8d\83AID
+                * @param x \8bL\89¯x\8dÀ\95W
+                * @param y \8bL\89¯y\8dÀ\95W
+                * @return \82È\82µ
+                */
+               void Lore::PutFieldLore(ID floorID, int x, int y);
+
+               /*!
+                * @brief \83t\83B\81[\83\8b\83h\8bL\89¯\82ð\95Ô\82·\81B
+                * @param floorID \8bL\89¯\82·\82é\83t\83\8d\83AID
+                * @param x \8bL\89¯x\8dÀ\95W
+                * @param y \8bL\89¯y\8dÀ\95W
+                * @return \8bL\89¯\93x\90\94
+                */
+               int Lore::GetFieldLore(ID floorID, int x, int y);
+
+
        };
 
 }