3 Copyright (C) 2013-8 celeron55, Perttu Ahola <celeron55@gmail.com>
4 Copyright (C) 2017-8 rubenwardy <rw@rubenwardy.com>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "irrlichttypes_bloated.h"
24 #include "lua_api/l_base.h"
32 class MetaDataRef : public ModApiBase
35 virtual ~MetaDataRef() = default;
38 static MetaDataRef *checkobject(lua_State *L, int narg);
40 virtual void reportMetadataChange() {}
41 virtual Metadata *getmeta(bool auto_create) = 0;
42 virtual void clearMeta() = 0;
44 virtual void handleToTable(lua_State *L, Metadata *meta);
45 virtual bool handleFromTable(lua_State *L, int table, Metadata *meta);
49 // contains(self, name)
50 static int l_contains(lua_State *L);
53 static int l_get(lua_State *L);
55 // get_string(self, name)
56 static int l_get_string(lua_State *L);
58 // set_string(self, name, var)
59 static int l_set_string(lua_State *L);
61 // get_int(self, name)
62 static int l_get_int(lua_State *L);
64 // set_int(self, name, var)
65 static int l_set_int(lua_State *L);
67 // get_float(self, name)
68 static int l_get_float(lua_State *L);
70 // set_float(self, name, var)
71 static int l_set_float(lua_State *L);
74 static int l_to_table(lua_State *L);
76 // from_table(self, table)
77 static int l_from_table(lua_State *L);
79 // equals(self, other)
80 static int l_equals(lua_State *L);