From 389fe31ace38a8f53c210ff5ae823eae1780dfc8 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 5 Apr 2011 00:24:47 +0300 Subject: changed node metadata format to better accomodate future needs and problems --- src/nodemetadata.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/nodemetadata.h') diff --git a/src/nodemetadata.h b/src/nodemetadata.h index 8877c2667..e8aa57622 100644 --- a/src/nodemetadata.h +++ b/src/nodemetadata.h @@ -56,6 +56,9 @@ public: virtual void serializeBody(std::ostream &os) = 0; virtual std::string infoText() {return "";} virtual Inventory* getInventory() {return NULL;} + // This is called always after the inventory is modified, before + // the changes are copied elsewhere + virtual void inventoryModified(){} protected: static void registerType(u16 id, Factory f); @@ -99,6 +102,28 @@ private: Inventory *m_inventory; }; +class FurnaceNodeMetadata : public NodeMetadata +{ +public: + FurnaceNodeMetadata(); + ~FurnaceNodeMetadata(); + + virtual u16 typeId() const; + virtual NodeMetadata* clone(); + static NodeMetadata* create(std::istream &is); + virtual void serializeBody(std::ostream &os); + virtual std::string infoText(); + virtual Inventory* getInventory() {return m_inventory;} + virtual void inventoryModified(); + +private: + Inventory *m_inventory; +}; + +/* + List of metadata of all the nodes of a block +*/ + class NodeMetadataList { public: -- cgit v1.2.3