Add cancel button to password change menu. (#5720)
[oweals/minetest.git] / src / nodemetadata.h
index 8d1298212d9e702eab99f1c6c457b5179273aea8..f46c0fe911037ee3e0120517df40741fa1467c0b 100644 (file)
@@ -20,10 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef NODEMETADATA_HEADER
 #define NODEMETADATA_HEADER
 
-#include "irr_v3d.h"
-#include <iostream>
-#include <vector>
-#include "util/string.h"
+#include "metadata.h"
 
 /*
        NodeMetadata stores arbitary amounts of data for special blocks.
@@ -37,7 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 class Inventory;
 class IItemDefManager;
 
-class NodeMetadata
+class NodeMetadata : public Metadata
 {
 public:
        NodeMetadata(IItemDefManager *item_def_mgr);
@@ -47,16 +44,7 @@ public:
        void deSerialize(std::istream &is);
 
        void clear();
-
-       // Generic key/value store
-       std::string getString(const std::string &name, unsigned short recursion = 0) const;
-       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;
-       StringMap getStrings() const
-       {
-               return m_stringvars;
-       }
+       bool empty() const;
 
        // The inventory
        Inventory *getInventory()
@@ -65,7 +53,6 @@ public:
        }
 
 private:
-       StringMap m_stringvars;
        Inventory *m_inventory;
 };
 
@@ -94,8 +81,9 @@ public:
        void clear();
 
 private:
+       int countNonEmpty() const;
+
        std::map<v3s16, NodeMetadata *> m_data;
 };
 
 #endif
-