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 static NodeMetadata* create(std::istream &is, IGameDef *gamedef);
35 virtual NodeMetadata* clone(IGameDef *gamedef);
36 virtual void serializeBody(std::ostream &os);
37 virtual std::string infoText();
39 virtual bool allowsTextInput(){ return true; }
40 virtual std::string getText(){ return m_text; }
41 virtual void setText(const std::string &t){ m_text = t; }
47 class ChestNodeMetadata : public NodeMetadata
50 ChestNodeMetadata(IGameDef *gamedef);
53 virtual u16 typeId() const;
54 static NodeMetadata* create(std::istream &is, IGameDef *gamedef);
55 virtual NodeMetadata* clone(IGameDef *gamedef);
56 virtual void serializeBody(std::ostream &os);
57 virtual std::string infoText();
58 virtual Inventory* getInventory() {return m_inventory;}
59 virtual bool nodeRemovalDisabled();
60 virtual std::string getInventoryDrawSpecString();
63 Inventory *m_inventory;
66 class LockingChestNodeMetadata : public NodeMetadata
69 LockingChestNodeMetadata(IGameDef *gamedef);
70 ~LockingChestNodeMetadata();
72 virtual u16 typeId() const;
73 static NodeMetadata* create(std::istream &is, IGameDef *gamedef);
74 virtual NodeMetadata* clone(IGameDef *gamedef);
75 virtual void serializeBody(std::ostream &os);
76 virtual std::string infoText();
77 virtual Inventory* getInventory() {return m_inventory;}
78 virtual bool nodeRemovalDisabled();
79 virtual std::string getInventoryDrawSpecString();
81 virtual std::string getOwner(){ return m_text; }
82 virtual void setOwner(std::string t){ m_text = t; }
85 Inventory *m_inventory;
89 class FurnaceNodeMetadata : public NodeMetadata
92 FurnaceNodeMetadata(IGameDef *gamedef);
93 ~FurnaceNodeMetadata();
95 virtual u16 typeId() const;
96 virtual NodeMetadata* clone(IGameDef *gamedef);
97 static NodeMetadata* create(std::istream &is, IGameDef *gamedef);
98 virtual void serializeBody(std::ostream &os);
99 virtual std::string infoText();
100 virtual Inventory* getInventory() {return m_inventory;}
101 virtual void inventoryModified();
102 virtual bool step(float dtime);
103 virtual bool nodeRemovalDisabled();
104 virtual std::string getInventoryDrawSpecString();
107 Inventory *m_inventory;
108 float m_step_accumulator;
109 float m_fuel_totaltime;
111 float m_src_totaltime;