Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
s_node.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation; either version 2.1 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public License along
16with this program; if not, write to the Free Software Foundation, Inc.,
1751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20#pragma once
21
22#include "irr_v3d.h"
23#include "cpp_api/s_base.h"
24#include "cpp_api/s_nodemeta.h"
25#include "util/string.h"
26
27struct MapNode;
29
30class ScriptApiNode
31 : virtual public ScriptApiBase,
33{
34public:
35 ScriptApiNode() = default;
36 virtual ~ScriptApiNode() = default;
37
38 bool node_on_punch(v3s16 p, MapNode node,
39 ServerActiveObject *puncher, const PointedThing &pointed);
40 bool node_on_dig(v3s16 p, MapNode node,
41 ServerActiveObject *digger);
42 void node_on_construct(v3s16 p, MapNode node);
43 void node_on_destruct(v3s16 p, MapNode node);
44 bool node_on_flood(v3s16 p, MapNode node, MapNode newnode);
46 bool node_on_timer(v3s16 p, MapNode node, f32 dtime);
48 const std::string &formname,
49 const StringMap &fields,
50 ServerActiveObject *sender);
51public:
52 static struct EnumString es_DrawType[];
55 static struct EnumString es_LiquidType[];
57 static struct EnumString es_NodeBoxType[];
59};
Definition: s_base.h:79
Definition: s_nodemeta.h:32
Definition: serveractiveobject.h:55
core::vector3d< s16 > v3s16
Definition: irr_v3d.h:28
std::unordered_map< std::string, std::string > StringMap
Definition: string.h:78
Definition: c_types.h:31
Definition: mapnode.h:139
An active object or node which is selected by a ray on the map.
Definition: pointedthing.h:37
Definition: s_node.cpp:32
static struct EnumString es_TextureAlphaMode[]
Definition: s_node.h:58
bool node_on_flood(v3s16 p, MapNode node, MapNode newnode)
Definition: s_node.cpp:193
bool node_on_dig(v3s16 p, MapNode node, ServerActiveObject *digger)
Definition: s_node.cpp:130
static struct EnumString es_ContentParamType2[]
Definition: s_node.h:54
static struct EnumString es_LiquidMoveType[]
Definition: s_node.h:56
bool node_on_timer(v3s16 p, MapNode node, f32 dtime)
Definition: s_node.cpp:233
static struct EnumString es_NodeBoxType[]
Definition: s_node.h:57
static struct EnumString es_DrawType[]
Definition: s_node.h:52
static struct EnumString es_ContentParamType[]
Definition: s_node.h:53
void node_on_receive_fields(v3s16 p, const std::string &formname, const StringMap &fields, ServerActiveObject *sender)
Definition: s_node.cpp:253
static struct EnumString es_LiquidType[]
Definition: s_node.h:55
void node_after_destruct(v3s16 p, MapNode node)
Definition: s_node.cpp:214
virtual ~ScriptApiNode()=default
bool node_on_punch(v3s16 p, MapNode node, ServerActiveObject *puncher, const PointedThing &pointed)
Definition: s_node.cpp:107
void node_on_construct(v3s16 p, MapNode node)
Definition: s_node.cpp:157
void node_on_destruct(v3s16 p, MapNode node)
Definition: s_node.cpp:175
ScriptApiNode()=default
static std::string p(std::string path)
Definition: test_filesys.cpp:64