]> git.lizzy.rs Git - minetest.git/blobdiff - src/nodemetadata.h
FormSpec: Add StaticTextSpec and superimpose over item image buttons
[minetest.git] / src / nodemetadata.h
index acd45bdf9bde4f3b7c85a6029a84bb536bfe7c01..8d1298212d9e702eab99f1c6c457b5179273aea8 100644 (file)
@@ -21,10 +21,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define NODEMETADATA_HEADER
 
 #include "irr_v3d.h"
-#include <string>
 #include <iostream>
 #include <vector>
-#include <map>
+#include "util/string.h"
 
 /*
        NodeMetadata stores arbitary amounts of data for special blocks.
@@ -36,12 +35,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 class Inventory;
-class IGameDef;
+class IItemDefManager;
 
 class NodeMetadata
 {
 public:
-       NodeMetadata(IGameDef *gamedef);
+       NodeMetadata(IItemDefManager *item_def_mgr);
        ~NodeMetadata();
 
        void serialize(std::ostream &os) const;
@@ -54,19 +53,19 @@ class NodeMetadata
        void setString(const std::string &name, const std::string &var);
        // Support variable names in values
        std::string resolveString(const std::string &str, unsigned short recursion = 0) const;
-       std::map<std::string, std::string> getStrings() const
+       StringMap getStrings() const
        {
                return m_stringvars;
        }
 
        // The inventory
-       InventorygetInventory()
+       Inventory *getInventory()
        {
                return m_inventory;
        }
 
 private:
-       std::map<std::string, std::string> m_stringvars;
+       StringMap m_stringvars;
        Inventory *m_inventory;
 };
 
@@ -81,7 +80,7 @@ class NodeMetadataList
        ~NodeMetadataList();
 
        void serialize(std::ostream &os) const;
-       void deSerialize(std::istream &is, IGameDef *gamedef);
+       void deSerialize(std::istream &is, IItemDefManager *item_def_mgr);
 
        // Add all keys in this list to the vector keys
        std::vector<v3s16> getAllKeys();