3 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef CONTENT_NODEMETA_HEADER
21 #define CONTENT_NODEMETA_HEADER
23 #include "nodemetadata.h"
27 class SignNodeMetadata : public NodeMetadata
30 SignNodeMetadata(IGameDef *gamedef, std::string text);
31 //~SignNodeMetadata();
33 virtual u16 typeId() const;
34 virtual const char* typeName() const
36 static NodeMetadata* create(std::istream &is, IGameDef *gamedef);
37 static NodeMetadata* create(IGameDef *gamedef);
38 virtual NodeMetadata* clone(IGameDef *gamedef);
39 virtual void serializeBody(std::ostream &os);
40 virtual std::string infoText();
42 virtual bool allowsTextInput(){ return true; }
43 virtual std::string getText(){ return m_text; }
44 virtual void setText(const std::string &t){ m_text = t; }
50 class ChestNodeMetadata : public NodeMetadata
53 ChestNodeMetadata(IGameDef *gamedef);
56 virtual u16 typeId() const;
57 virtual const char* typeName() const
59 static NodeMetadata* create(std::istream &is, IGameDef *gamedef);
60 static NodeMetadata* create(IGameDef *gamedef);
61 virtual NodeMetadata* clone(IGameDef *gamedef);
62 virtual void serializeBody(std::ostream &os);
63 virtual std::string infoText();
64 virtual Inventory* getInventory() {return m_inventory;}
65 virtual bool nodeRemovalDisabled();
66 virtual std::string getInventoryDrawSpecString();
69 Inventory *m_inventory;
72 class LockingChestNodeMetadata : public NodeMetadata
75 LockingChestNodeMetadata(IGameDef *gamedef);
76 ~LockingChestNodeMetadata();
78 virtual u16 typeId() const;
79 virtual const char* typeName() const
80 { return "locked_chest"; }
81 static NodeMetadata* create(std::istream &is, IGameDef *gamedef);
82 static NodeMetadata* create(IGameDef *gamedef);
83 virtual NodeMetadata* clone(IGameDef *gamedef);
84 virtual void serializeBody(std::ostream &os);
85 virtual std::string infoText();
86 virtual Inventory* getInventory() {return m_inventory;}
87 virtual bool nodeRemovalDisabled();
88 virtual std::string getInventoryDrawSpecString();
90 virtual std::string getOwner(){ return m_text; }
91 virtual void setOwner(std::string t){ m_text = t; }
94 Inventory *m_inventory;
98 class FurnaceNodeMetadata : public NodeMetadata
101 FurnaceNodeMetadata(IGameDef *gamedef);
102 ~FurnaceNodeMetadata();
104 virtual u16 typeId() const;
105 virtual const char* typeName() const
106 { return "furnace"; }
107 virtual NodeMetadata* clone(IGameDef *gamedef);
108 static NodeMetadata* create(std::istream &is, IGameDef *gamedef);
109 static NodeMetadata* create(IGameDef *gamedef);
110 virtual void serializeBody(std::ostream &os);
111 virtual std::string infoText();
112 virtual Inventory* getInventory() {return m_inventory;}
113 virtual void inventoryModified();
114 virtual bool step(float dtime);
115 virtual bool nodeRemovalDisabled();
116 virtual std::string getInventoryDrawSpecString();
119 Inventory *m_inventory;
120 float m_step_accumulator;
121 float m_fuel_totaltime;
123 float m_src_totaltime;