diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-04-05 00:24:47 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-04-05 00:24:47 +0300 |
commit | 389fe31ace38a8f53c210ff5ae823eae1780dfc8 (patch) | |
tree | 3d66530794524c140a420e6f6c665c94e7d49162 /src/nodemetadata.h | |
parent | 042834b09d8d2d814204244e3a64f5fb1cb7582c (diff) | |
download | hax-minetest-server-389fe31ace38a8f53c210ff5ae823eae1780dfc8.tar.gz hax-minetest-server-389fe31ace38a8f53c210ff5ae823eae1780dfc8.zip |
changed node metadata format to better accomodate future needs and problems
Diffstat (limited to 'src/nodemetadata.h')
-rw-r--r-- | src/nodemetadata.h | 25 |
1 files changed, 25 insertions, 0 deletions
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 "<todo: remove this text>";} 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: |