Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
l_localplayer.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2017 Dumbeldor, Vincent Glize <vincent.glize@live.fr>
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 "l_base.h"
23
24class LocalPlayer;
25
27{
28private:
29 static const luaL_Reg methods[];
30
31 // garbage collector
32 static int gc_object(lua_State *L);
33
34 // get_velocity(self)
35 static int l_get_velocity(lua_State *L);
36
37 // get_hp(self)
38 static int l_get_hp(lua_State *L);
39
40 // get_name(self)
41 static int l_get_name(lua_State *L);
42
43 // get_wield_index(self)
44 static int l_get_wield_index(lua_State *L);
45
46 // get_wielded_item(self)
47 static int l_get_wielded_item(lua_State *L);
48
49 static int l_is_attached(lua_State *L);
50 static int l_is_touching_ground(lua_State *L);
51 static int l_is_in_liquid(lua_State *L);
52 static int l_is_in_liquid_stable(lua_State *L);
53 static int l_is_climbing(lua_State *L);
54 static int l_swimming_vertical(lua_State *L);
55
56 static int l_get_physics_override(lua_State *L);
57
58 static int l_get_override_pos(lua_State *L);
59
60 static int l_get_last_pos(lua_State *L);
61 static int l_get_last_velocity(lua_State *L);
62 static int l_get_last_look_vertical(lua_State *L);
63 static int l_get_last_look_horizontal(lua_State *L);
64
65 // get_control(self)
66 static int l_get_control(lua_State *L);
67
68 // get_breath(self)
69 static int l_get_breath(lua_State *L);
70
71 // get_pos(self)
72 static int l_get_pos(lua_State *L);
73
74 // get_movement_acceleration(self)
75 static int l_get_movement_acceleration(lua_State *L);
76
77 // get_movement_speed(self)
78 static int l_get_movement_speed(lua_State *L);
79
80 // get_movement(self)
81 static int l_get_movement(lua_State *L);
82
83 // get_armor_groups(self)
84 static int l_get_armor_groups(lua_State *L);
85
86 // hud_add(self, id, form)
87 static int l_hud_add(lua_State *L);
88
89 // hud_rm(self, id)
90 static int l_hud_remove(lua_State *L);
91
92 // hud_change(self, id, stat, data)
93 static int l_hud_change(lua_State *L);
94 // hud_get(self, id)
95 static int l_hud_get(lua_State *L);
96 // hud_get_all(self)
97 static int l_hud_get_all(lua_State *L);
98
99 static int l_get_move_resistance(lua_State *L);
100
102 static LocalPlayer *getobject(lua_State *L, int narg);
103
105
106public:
108 ~LuaLocalPlayer() = default;
109
110 static void create(lua_State *L, LocalPlayer *m);
111
112 static void Register(lua_State *L);
113
114 static const char className[];
115};
Definition: localplayer.h:64
Definition: l_localplayer.h:27
static int l_get_move_resistance(lua_State *L)
Definition: l_localplayer.cpp:131
static int l_get_physics_override(lua_State *L)
Definition: l_localplayer.cpp:156
static int l_is_touching_ground(lua_State *L)
Definition: l_localplayer.cpp:107
static int l_get_velocity(lua_State *L)
Definition: l_localplayer.cpp:55
static int l_get_last_look_vertical(lua_State *L)
Definition: l_localplayer.cpp:229
static int l_get_control(lua_State *L)
Definition: l_localplayer.cpp:246
static int l_get_last_pos(lua_State *L)
Definition: l_localplayer.cpp:213
static int l_hud_change(lua_State *L)
Definition: l_localplayer.cpp:399
static const luaL_Reg methods[]
Definition: l_localplayer.h:29
static int l_is_in_liquid(lua_State *L)
Definition: l_localplayer.cpp:115
static int l_get_name(lua_State *L)
Definition: l_localplayer.cpp:71
static int gc_object(lua_State *L)
Definition: l_localplayer.cpp:468
static int l_get_pos(lua_State *L)
Definition: l_localplayer.cpp:287
static int l_is_attached(lua_State *L)
Definition: l_localplayer.cpp:99
static int l_get_armor_groups(lua_State *L)
Definition: l_localplayer.cpp:360
static int l_hud_get(lua_State *L)
Definition: l_localplayer.cpp:418
static int l_is_in_liquid_stable(lua_State *L)
Definition: l_localplayer.cpp:123
static int l_get_last_velocity(lua_State *L)
Definition: l_localplayer.cpp:221
static const char className[]
Definition: l_localplayer.h:114
static int l_get_breath(lua_State *L)
Definition: l_localplayer.cpp:278
static int l_swimming_vertical(lua_State *L)
Definition: l_localplayer.cpp:147
~LuaLocalPlayer()=default
static int l_get_movement_speed(lua_State *L)
Definition: l_localplayer.cpp:314
static int l_hud_remove(lua_State *L)
Definition: l_localplayer.cpp:385
static int l_get_movement(lua_State *L)
Definition: l_localplayer.cpp:338
static int l_is_climbing(lua_State *L)
Definition: l_localplayer.cpp:139
static int l_get_wield_index(lua_State *L)
Definition: l_localplayer.cpp:80
static int l_get_movement_acceleration(lua_State *L)
Definition: l_localplayer.cpp:296
static LocalPlayer * getobject(LuaLocalPlayer *ref)
Definition: l_localplayer.cpp:454
static int l_get_last_look_horizontal(lua_State *L)
Definition: l_localplayer.cpp:237
static int l_hud_add(lua_State *L)
Definition: l_localplayer.cpp:368
static void create(lua_State *L, LocalPlayer *m)
Definition: l_localplayer.cpp:33
static int l_get_hp(lua_State *L)
Definition: l_localplayer.cpp:63
static int l_hud_get_all(lua_State *L)
Definition: l_localplayer.cpp:435
static int l_get_wielded_item(lua_State *L)
Definition: l_localplayer.cpp:89
static int l_get_override_pos(lua_State *L)
LocalPlayer * m_localplayer
Definition: l_localplayer.h:104
Definition: l_base.h:43