1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Chests work now!

This commit is contained in:
Perttu Ahola 2011-04-04 15:13:19 +03:00
parent 9e683fff50
commit 4a92df6ff0
17 changed files with 519 additions and 147 deletions

View file

@ -37,6 +37,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
- Text
*/
class Inventory;
class NodeMetadata
{
public:
@ -52,7 +54,8 @@ public:
virtual u16 typeId() const = 0;
virtual NodeMetadata* clone() = 0;
virtual void serializeBody(std::ostream &os) = 0;
virtual std::string infoText() { return "<todo: remove this text>"; }
virtual std::string infoText() {return "<todo: remove this text>";}
virtual Inventory* getInventory() {return NULL;}
protected:
static void registerType(u16 id, Factory f);
@ -83,14 +86,17 @@ class ChestNodeMetadata : public NodeMetadata
{
public:
ChestNodeMetadata();
~ChestNodeMetadata();
virtual u16 typeId() const;
static NodeMetadata* create(std::istream &is);
virtual NodeMetadata* clone();
virtual void serializeBody(std::ostream &os);
virtual std::string infoText();
virtual Inventory* getInventory() {return m_inventory;}
private:
Inventory *m_inventory;
};
class NodeMetadataList