Luanti
5.10.0-dev
Loading...
Searching...
No Matches
l_metadata.h
Go to the documentation of this file.
1
// Luanti
2
// SPDX-License-Identifier: LGPL-2.1-or-later
3
// Copyright (C) 2013-8 celeron55, Perttu Ahola <celeron55@gmail.com>
4
// Copyright (C) 2017-8 rubenwardy <rw@rubenwardy.com>
5
6
#pragma once
7
8
#include "
irrlichttypes_bloated.h
"
9
#include "
lua_api/l_base.h
"
10
11
class
IMetadata
;
12
13
/*
14
NodeMetaRef
15
*/
16
17
class
MetaDataRef
:
public
ModApiBase
18
{
19
public
:
20
virtual
~MetaDataRef
() =
default
;
21
22
static
MetaDataRef
*
checkAnyMetadata
(lua_State *L,
int
narg);
23
24
protected
:
25
virtual
void
reportMetadataChange
(
const
std::string *name =
nullptr
) {}
26
virtual
IMetadata
*
getmeta
(
bool
auto_create) = 0;
27
virtual
void
clearMeta
() = 0;
28
29
virtual
void
handleToTable
(lua_State *L,
IMetadata
*meta);
30
virtual
bool
handleFromTable
(lua_State *L,
int
table
,
IMetadata
*meta);
31
32
static
void
registerMetadataClass
(lua_State *L,
const
char
*name,
const
luaL_Reg *methods);
33
34
// Exported functions
35
36
static
int
gc_object
(lua_State *L);
37
38
// contains(self, name)
39
static
int
l_contains
(lua_State *L);
40
41
// get(self, name)
42
static
int
l_get
(lua_State *L);
43
44
// get_string(self, name)
45
static
int
l_get_string
(lua_State *L);
46
47
// set_string(self, name, var)
48
static
int
l_set_string
(lua_State *L);
49
50
// get_int(self, name)
51
static
int
l_get_int
(lua_State *L);
52
53
// set_int(self, name, var)
54
static
int
l_set_int
(lua_State *L);
55
56
// get_float(self, name)
57
static
int
l_get_float
(lua_State *L);
58
59
// set_float(self, name, var)
60
static
int
l_set_float
(lua_State *L);
61
62
// get_keys(self)
63
static
int
l_get_keys
(lua_State *L);
64
65
// to_table(self)
66
static
int
l_to_table
(lua_State *L);
67
68
// from_table(self, table)
69
static
int
l_from_table
(lua_State *L);
70
71
// equals(self, other)
72
static
int
l_equals
(lua_State *L);
73
};
IMetadata
Definition
metadata.h:14
MetaDataRef
Definition
l_metadata.h:18
MetaDataRef::registerMetadataClass
static void registerMetadataClass(lua_State *L, const char *name, const luaL_Reg *methods)
Definition
l_metadata.cpp:316
MetaDataRef::l_from_table
static int l_from_table(lua_State *L)
Definition
l_metadata.cpp:237
MetaDataRef::handleToTable
virtual void handleToTable(lua_State *L, IMetadata *meta)
Definition
l_metadata.cpp:265
MetaDataRef::l_get
static int l_get(lua_State *L)
Definition
l_metadata.cpp:56
MetaDataRef::checkAnyMetadata
static MetaDataRef * checkAnyMetadata(lua_State *L, int narg)
Definition
l_metadata.cpp:14
MetaDataRef::l_get_int
static int l_get_int(lua_State *L)
Definition
l_metadata.cpp:118
MetaDataRef::handleFromTable
virtual bool handleFromTable(lua_State *L, int table, IMetadata *meta)
Definition
l_metadata.cpp:282
MetaDataRef::gc_object
static int gc_object(lua_State *L)
Definition
l_metadata.cpp:30
MetaDataRef::l_set_int
static int l_set_int(lua_State *L)
Definition
l_metadata.cpp:138
MetaDataRef::l_get_float
static int l_get_float(lua_State *L)
Definition
l_metadata.cpp:154
MetaDataRef::~MetaDataRef
virtual ~MetaDataRef()=default
MetaDataRef::getmeta
virtual IMetadata * getmeta(bool auto_create)=0
MetaDataRef::l_equals
static int l_equals(lua_State *L)
Definition
l_metadata.cpp:303
MetaDataRef::l_get_keys
static int l_get_keys(lua_State *L)
Definition
l_metadata.cpp:193
MetaDataRef::l_get_string
static int l_get_string(lua_State *L)
Definition
l_metadata.cpp:77
MetaDataRef::clearMeta
virtual void clearMeta()=0
MetaDataRef::l_set_float
static int l_set_float(lua_State *L)
Definition
l_metadata.cpp:176
MetaDataRef::l_to_table
static int l_to_table(lua_State *L)
Definition
l_metadata.cpp:218
MetaDataRef::l_contains
static int l_contains(lua_State *L)
Definition
l_metadata.cpp:40
MetaDataRef::l_set_string
static int l_set_string(lua_State *L)
Definition
l_metadata.cpp:97
MetaDataRef::reportMetadataChange
virtual void reportMetadataChange(const std::string *name=nullptr)
Definition
l_metadata.h:25
ModApiBase
Definition
l_base.h:28
irrlichttypes_bloated.h
table
static const struct table_key table[]
Definition
keycode.cpp:33
l_base.h
script
lua_api
l_metadata.h
Generated on Fri Nov 1 2024 10:49:00 for Luanti by
1.11.0