aboutsummaryrefslogtreecommitdiff
path: root/src/nodemetadata.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nodemetadata.h')
-rw-r--r--src/nodemetadata.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nodemetadata.h b/src/nodemetadata.h
index 5b2f129a1..9eb08678a 100644
--- a/src/nodemetadata.h
+++ b/src/nodemetadata.h
@@ -34,21 +34,22 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
class Inventory;
+class IGameDef;
class NodeMetadata
{
public:
- typedef NodeMetadata* (*Factory)(std::istream&);
+ typedef NodeMetadata* (*Factory)(std::istream&, IGameDef *gamedef);
- NodeMetadata();
+ NodeMetadata(IGameDef *gamedef);
virtual ~NodeMetadata();
- static NodeMetadata* deSerialize(std::istream &is);
+ static NodeMetadata* deSerialize(std::istream &is, IGameDef *gamedef);
void serialize(std::ostream &os);
// This usually is the CONTENT_ value
virtual u16 typeId() const = 0;
- virtual NodeMetadata* clone() = 0;
+ virtual NodeMetadata* clone(IGameDef *gamedef) = 0;
virtual void serializeBody(std::ostream &os) = 0;
virtual std::string infoText() {return "";}
virtual Inventory* getInventory() {return NULL;}
@@ -69,6 +70,7 @@ public:
virtual void setText(const std::string &t){}
protected:
static void registerType(u16 id, Factory f);
+ IGameDef *m_gamedef;
private:
static core::map<u16, Factory> m_types;
};
@@ -83,7 +85,7 @@ public:
~NodeMetadataList();
void serialize(std::ostream &os);
- void deSerialize(std::istream &is);
+ void deSerialize(std::istream &is, IGameDef *gamedef);
// Get pointer to data
NodeMetadata* get(v3s16 p);