Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
l_nodetimer.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 "lua_api/l_base.h"
24
25class ServerMap;
26
28{
29private:
32
33 static const luaL_Reg methods[];
34
35 static int gc_object(lua_State *L);
36
37 static int l_set(lua_State *L);
38
39 static int l_start(lua_State *L);
40
41 static int l_stop(lua_State *L);
42
43 static int l_is_started(lua_State *L);
44
45 static int l_get_timeout(lua_State *L);
46
47 static int l_get_elapsed(lua_State *L);
48
49public:
50 NodeTimerRef(v3s16 p, ServerMap *map) : m_p(p), m_map(map) {}
51 ~NodeTimerRef() = default;
52
53 // Creates an NodeTimerRef and leaves it on top of stack
54 // Not callable from Lua; all references are created on the C side.
55 static void create(lua_State *L, v3s16 p, ServerMap *map);
56
57 static void Register(lua_State *L);
58
59 static const char className[];
60};
Definition: l_base.h:43
Definition: l_nodetimer.h:28
static int l_start(lua_State *L)
Definition: l_nodetimer.cpp:42
v3s16 m_p
Definition: l_nodetimer.h:30
static int l_is_started(lua_State *L)
Definition: l_nodetimer.cpp:59
static const luaL_Reg methods[]
Definition: l_nodetimer.h:33
static const char className[]
Definition: l_nodetimer.h:59
static int l_set(lua_State *L)
Definition: l_nodetimer.cpp:32
static int l_stop(lua_State *L)
Definition: l_nodetimer.cpp:51
static int gc_object(lua_State *L)
Definition: l_nodetimer.cpp:26
NodeTimerRef(v3s16 p, ServerMap *map)
Definition: l_nodetimer.h:50
static void create(lua_State *L, v3s16 p, ServerMap *map)
Definition: l_nodetimer.cpp:88
~NodeTimerRef()=default
static int l_get_timeout(lua_State *L)
Definition: l_nodetimer.cpp:68
static int l_get_elapsed(lua_State *L)
Definition: l_nodetimer.cpp:77
ServerMap * m_map
Definition: l_nodetimer.h:31
Definition: servermap.h:46
core::vector3d< s16 > v3s16
Definition: irr_v3d.h:28
static std::string p(std::string path)
Definition: test_filesys.cpp:64