Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
s_entity.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include "cpp_api/s_base.h"
8#include "irr_v3d.h"
9#include <unordered_set>
10
11struct ObjectProperties;
12struct ToolCapabilities;
14
16 : virtual public ScriptApiBase
17{
18public:
19 bool luaentity_Add(u16 id, const char *name);
20 void luaentity_Activate(u16 id,
21 const std::string &staticdata, u32 dtime_s);
22 void luaentity_Deactivate(u16 id, bool removal);
23 void luaentity_Remove(u16 id);
24 std::string luaentity_GetStaticdata(u16 id);
25 void luaentity_GetProperties(u16 id,
26 ServerActiveObject *self, ObjectProperties *prop, const std::string &entity_name);
27 void luaentity_Step(u16 id, float dtime,
28 const collisionMoveResult *moveresult);
29 bool luaentity_Punch(u16 id,
30 ServerActiveObject *puncher, float time_from_last_punch,
31 const ToolCapabilities *toolcap, v3f dir, s32 damage);
32 bool luaentity_on_death(u16 id, ServerActiveObject *killer);
33 void luaentity_Rightclick(u16 id, ServerActiveObject *clicker);
36 void luaentity_on_detach(u16 id, ServerActiveObject *parent);
37private:
39 const char *field);
40
41 void logDeprecationForExistingProperties(lua_State *L, int index, const std::string &name);
42
46 std::unordered_set<std::string> deprecation_warned_init_properties;
47};
static v2f dir(const v2f &pos_dist)
Definition camera.cpp:191
Definition s_base.h:64
Definition s_entity.h:17
void luaentity_on_detach_child(u16 id, ServerActiveObject *child)
Definition s_entity.cpp:330
bool luaentity_run_simple_callback(u16 id, ServerActiveObject *sao, const char *field)
Definition s_entity.cpp:282
void luaentity_Rightclick(u16 id, ServerActiveObject *clicker)
Definition s_entity.cpp:320
bool luaentity_Add(u16 id, const char *name)
Definition s_entity.cpp:13
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:46
void luaentity_on_detach(u16 id, ServerActiveObject *parent)
Definition s_entity.cpp:335
std::string luaentity_GetStaticdata(u16 id)
Definition s_entity.cpp:127
void luaentity_Activate(u16 id, const std::string &staticdata, u32 dtime_s)
Definition s_entity.cpp:58
void luaentity_Deactivate(u16 id, bool removal)
Definition s_entity.cpp:85
bool luaentity_on_death(u16 id, ServerActiveObject *killer)
Definition s_entity.cpp:314
void luaentity_on_attach_child(u16 id, ServerActiveObject *child)
Definition s_entity.cpp:325
bool luaentity_Punch(u16 id, ServerActiveObject *puncher, float time_from_last_punch, const ToolCapabilities *toolcap, v3f dir, s32 damage)
Definition s_entity.cpp:244
void luaentity_GetProperties(u16 id, ServerActiveObject *self, ObjectProperties *prop, const std::string &entity_name)
Definition s_entity.cpp:189
void luaentity_Remove(u16 id)
Definition s_entity.cpp:109
void luaentity_Step(u16 id, float dtime, const collisionMoveResult *moveresult)
Definition s_entity.cpp:210
void logDeprecationForExistingProperties(lua_State *L, int index, const std::string &name)
Definition s_entity.cpp:158
Definition serveractiveobject.h:41
core::vector3df v3f
Definition irr_v3d.h:11
Definition object_properties.h:15
Definition tool.h:46
Definition collision.h:43