]> git.lizzy.rs Git - dragonfireclient.git/blob - src/script/cpp_api/s_node.h
Fix CSM crash (#5779)
[dragonfireclient.git] / src / script / cpp_api / s_node.h
1 /*
2 Minetest
3 Copyright (C) 2013 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 Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser 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 S_NODE_H_
21 #define S_NODE_H_
22
23 #include "irr_v3d.h"
24 #include "cpp_api/s_base.h"
25 #include "cpp_api/s_nodemeta.h"
26 #include "util/string.h"
27
28 struct MapNode;
29 class ServerActiveObject;
30
31 class ScriptApiNode
32                 : virtual public ScriptApiBase,
33                   public ScriptApiNodemeta
34 {
35 public:
36         ScriptApiNode();
37         virtual ~ScriptApiNode();
38
39         bool node_on_punch(v3s16 p, MapNode node,
40                         ServerActiveObject *puncher, PointedThing pointed);
41         bool node_on_dig(v3s16 p, MapNode node,
42                         ServerActiveObject *digger);
43         void node_on_construct(v3s16 p, MapNode node);
44         void node_on_destruct(v3s16 p, MapNode node);
45         bool node_on_flood(v3s16 p, MapNode node, MapNode newnode);
46         void node_after_destruct(v3s16 p, MapNode node);
47         bool node_on_timer(v3s16 p, MapNode node, f32 dtime);
48         void node_on_receive_fields(v3s16 p,
49                         const std::string &formname,
50                         const StringMap &fields,
51                         ServerActiveObject *sender);
52         void node_falling_update(v3s16 p);
53         void node_falling_update_single(v3s16 p);
54 public:
55         static struct EnumString es_DrawType[];
56         static struct EnumString es_ContentParamType[];
57         static struct EnumString es_ContentParamType2[];
58         static struct EnumString es_LiquidType[];
59         static struct EnumString es_NodeBoxType[];
60 };
61
62
63
64 #endif /* S_NODE_H_ */