Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
l_nodetimer.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 "irr_v3d.h"
8#include "lua_api/l_base.h"
9
10class ServerMap;
11
13{
14private:
17
18 static const luaL_Reg methods[];
19
20 static int gc_object(lua_State *L);
21
22 static int l_set(lua_State *L);
23
24 static int l_start(lua_State *L);
25
26 static int l_stop(lua_State *L);
27
28 static int l_is_started(lua_State *L);
29
30 static int l_get_timeout(lua_State *L);
31
32 static int l_get_elapsed(lua_State *L);
33
34public:
35 NodeTimerRef(v3s16 p, ServerMap *map) : m_p(p), m_map(map) {}
36 ~NodeTimerRef() = default;
37
38 // Creates an NodeTimerRef and leaves it on top of stack
39 // Not callable from Lua; all references are created on the C side.
40 static void create(lua_State *L, v3s16 p, ServerMap *map);
41
42 static void Register(lua_State *L);
43
44 static const char className[];
45};
Definition l_base.h:28
Definition l_nodetimer.h:13
static int l_start(lua_State *L)
Definition l_nodetimer.cpp:27
v3s16 m_p
Definition l_nodetimer.h:15
static int l_is_started(lua_State *L)
Definition l_nodetimer.cpp:44
static const luaL_Reg methods[]
Definition l_nodetimer.h:94
static const char className[]
Definition l_nodetimer.h:44
static int l_set(lua_State *L)
Definition l_nodetimer.cpp:17
static int l_stop(lua_State *L)
Definition l_nodetimer.cpp:36
static int gc_object(lua_State *L)
Definition l_nodetimer.cpp:11
NodeTimerRef(v3s16 p, ServerMap *map)
Definition l_nodetimer.h:35
static void create(lua_State *L, v3s16 p, ServerMap *map)
Definition l_nodetimer.cpp:73
~NodeTimerRef()=default
static int l_get_timeout(lua_State *L)
Definition l_nodetimer.cpp:53
static int l_get_elapsed(lua_State *L)
Definition l_nodetimer.cpp:62
ServerMap * m_map
Definition l_nodetimer.h:16
Definition servermap.h:44
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
static std::string p(std::string path)
Definition test_filesys.cpp:53