summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_nodemeta.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api/l_nodemeta.h')
-rw-r--r--src/script/lua_api/l_nodemeta.h35
1 files changed, 8 insertions, 27 deletions
diff --git a/src/script/lua_api/l_nodemeta.h b/src/script/lua_api/l_nodemeta.h
index 4ce338b18..d03f086c9 100644
--- a/src/script/lua_api/l_nodemeta.h
+++ b/src/script/lua_api/l_nodemeta.h
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define L_NODEMETA_H_
#include "lua_api/l_base.h"
+#include "lua_api/l_metadata.h"
#include "irrlichttypes_bloated.h"
class ServerEnvironment;
@@ -29,7 +30,7 @@ class NodeMetadata;
NodeMetaRef
*/
-class NodeMetaRef : public ModApiBase {
+class NodeMetaRef : public MetaDataRef {
private:
v3s16 m_p;
ServerEnvironment *m_env;
@@ -52,42 +53,22 @@ private:
* @param auto_create when true, try to create metadata information for the node if it has none.
* @return pointer to a @c NodeMetadata object or @c NULL in case of error.
*/
- virtual NodeMetadata* getmeta(bool auto_create);
+ virtual Metadata* getmeta(bool auto_create);
+ virtual void clearMeta();
- static void reportMetadataChange(NodeMetaRef *ref);
+ virtual void reportMetadataChange();
+
+ virtual void handleToTable(lua_State *L, Metadata *_meta);
+ virtual bool handleFromTable(lua_State *L, int table, Metadata *_meta);
// Exported functions
// garbage collector
static int gc_object(lua_State *L);
- // get_string(self, name)
- static int l_get_string(lua_State *L);
-
- // set_string(self, name, var)
- static int l_set_string(lua_State *L);
-
- // get_int(self, name)
- static int l_get_int(lua_State *L);
-
- // set_int(self, name, var)
- static int l_set_int(lua_State *L);
-
- // get_float(self, name)
- static int l_get_float(lua_State *L);
-
- // set_float(self, name, var)
- static int l_set_float(lua_State *L);
-
// get_inventory(self)
static int l_get_inventory(lua_State *L);
- // to_table(self)
- static int l_to_table(lua_State *L);
-
- // from_table(self, table)
- static int l_from_table(lua_State *L);
-
public:
NodeMetaRef(v3s16 p, ServerEnvironment *env);