#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.
*/
class Inventory;
-class IGameDef;
+class IItemDefManager;
-class NodeMetadata
+class NodeMetadata : public Metadata
{
public:
- NodeMetadata(IGameDef *gamedef);
+ NodeMetadata(IItemDefManager *item_def_mgr);
~NodeMetadata();
void serialize(std::ostream &os) const;
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()
}
private:
- StringMap m_stringvars;
Inventory *m_inventory;
};
~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();
void clear();
private:
+ int countNonEmpty() const;
+
std::map<v3s16, NodeMetadata *> m_data;
};
#endif
-