Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
s_entity.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 "cpp_api/s_base.h"
23#include "irr_v3d.h"
24#include <unordered_set>
25
26struct ObjectProperties;
27struct ToolCapabilities;
29
31 : virtual public ScriptApiBase
32{
33public:
34 bool luaentity_Add(u16 id, const char *name);
35 void luaentity_Activate(u16 id,
36 const std::string &staticdata, u32 dtime_s);
37 void luaentity_Deactivate(u16 id, bool removal);
38 void luaentity_Remove(u16 id);
39 std::string luaentity_GetStaticdata(u16 id);
40 void luaentity_GetProperties(u16 id,
41 ServerActiveObject *self, ObjectProperties *prop, const std::string &entity_name);
42 void luaentity_Step(u16 id, float dtime,
43 const collisionMoveResult *moveresult);
44 bool luaentity_Punch(u16 id,
45 ServerActiveObject *puncher, float time_from_last_punch,
46 const ToolCapabilities *toolcap, v3f dir, s32 damage);
47 bool luaentity_on_death(u16 id, ServerActiveObject *killer);
48 void luaentity_Rightclick(u16 id, ServerActiveObject *clicker);
51 void luaentity_on_detach(u16 id, ServerActiveObject *parent);
52private:
54 const char *field);
55
56 void logDeprecationForExistingProperties(lua_State *L, int index, const std::string &name);
57
61 std::unordered_set<std::string> deprecation_warned_init_properties;
62};
static v2f dir(const v2f &pos_dist)
Definition: camera.cpp:204
Definition: s_base.h:79
Definition: s_entity.h:32
void luaentity_on_detach_child(u16 id, ServerActiveObject *child)
Definition: s_entity.cpp:345
bool luaentity_run_simple_callback(u16 id, ServerActiveObject *sao, const char *field)
Definition: s_entity.cpp:297
void luaentity_Rightclick(u16 id, ServerActiveObject *clicker)
Definition: s_entity.cpp:335
bool luaentity_Add(u16 id, const char *name)
Definition: s_entity.cpp:28
std::unordered_set< std::string > deprecation_warned_init_properties
Stores names of entities that already caused a deprecation warning due to properties being outside of...
Definition: s_entity.h:61
void luaentity_on_detach(u16 id, ServerActiveObject *parent)
Definition: s_entity.cpp:350
std::string luaentity_GetStaticdata(u16 id)
Definition: s_entity.cpp:142
void luaentity_Activate(u16 id, const std::string &staticdata, u32 dtime_s)
Definition: s_entity.cpp:73
void luaentity_Deactivate(u16 id, bool removal)
Definition: s_entity.cpp:100
bool luaentity_on_death(u16 id, ServerActiveObject *killer)
Definition: s_entity.cpp:329
void luaentity_on_attach_child(u16 id, ServerActiveObject *child)
Definition: s_entity.cpp:340
bool luaentity_Punch(u16 id, ServerActiveObject *puncher, float time_from_last_punch, const ToolCapabilities *toolcap, v3f dir, s32 damage)
Definition: s_entity.cpp:259
void luaentity_GetProperties(u16 id, ServerActiveObject *self, ObjectProperties *prop, const std::string &entity_name)
Definition: s_entity.cpp:204
void luaentity_Remove(u16 id)
Definition: s_entity.cpp:124
void luaentity_Step(u16 id, float dtime, const collisionMoveResult *moveresult)
Definition: s_entity.cpp:225
void logDeprecationForExistingProperties(lua_State *L, int index, const std::string &name)
Definition: s_entity.cpp:173
Definition: serveractiveobject.h:55
core::vector3df v3f
Definition: irr_v3d.h:26
Definition: object_properties.h:32
Definition: tool.h:61
Definition: collision.h:58