lava!
[oweals/minetest.git] / src / content_nodemeta.h
1 /*
2 Minetest-c55
3 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
4
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.
9
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.
14
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.
18 */
19
20 #ifndef CONTENT_NODEMETA_HEADER
21 #define CONTENT_NODEMETA_HEADER
22
23 #include "nodemetadata.h"
24
25 class Inventory;
26
27 class SignNodeMetadata : public NodeMetadata
28 {
29 public:
30         SignNodeMetadata(std::string text);
31         //~SignNodeMetadata();
32         
33         virtual u16 typeId() const;
34         static NodeMetadata* create(std::istream &is);
35         virtual NodeMetadata* clone();
36         virtual void serializeBody(std::ostream &os);
37         virtual std::string infoText();
38
39         std::string getText(){ return m_text; }
40         void setText(std::string t){ m_text = t; }
41
42 private:
43         std::string m_text;
44 };
45
46 class ChestNodeMetadata : public NodeMetadata
47 {
48 public:
49         ChestNodeMetadata();
50         ~ChestNodeMetadata();
51         
52         virtual u16 typeId() const;
53         static NodeMetadata* create(std::istream &is);
54         virtual NodeMetadata* clone();
55         virtual void serializeBody(std::ostream &os);
56         virtual std::string infoText();
57         virtual Inventory* getInventory() {return m_inventory;}
58         virtual bool nodeRemovalDisabled();
59         virtual std::string getInventoryDrawSpecString();
60         
61 private:
62         Inventory *m_inventory;
63 };
64
65 class FurnaceNodeMetadata : public NodeMetadata
66 {
67 public:
68         FurnaceNodeMetadata();
69         ~FurnaceNodeMetadata();
70         
71         virtual u16 typeId() const;
72         virtual NodeMetadata* clone();
73         static NodeMetadata* create(std::istream &is);
74         virtual void serializeBody(std::ostream &os);
75         virtual std::string infoText();
76         virtual Inventory* getInventory() {return m_inventory;}
77         virtual void inventoryModified();
78         virtual bool step(float dtime);
79         virtual std::string getInventoryDrawSpecString();
80
81 private:
82         Inventory *m_inventory;
83         float m_step_accumulator;
84         float m_fuel_totaltime;
85         float m_fuel_time;
86         float m_src_totaltime;
87         float m_src_time;
88 };
89
90
91 #endif
92