diff options
author | rubenwardy <rubenwardy@gmail.com> | 2017-01-31 16:43:45 +0000 |
---|---|---|
committer | rubenwardy <rubenwardy@gmail.com> | 2017-02-04 22:07:55 +0000 |
commit | c2e7b1f57941cb34cb7e3d71dc040fad53a64e3e (patch) | |
tree | d62246a6838911aef8b71fd420e8b6c2ac455993 /src/script/lua_api/l_nodemeta.h | |
parent | 13f94ecad5d4fcda08663ee91e45b4a205a1dadb (diff) | |
download | minetest-c2e7b1f57941cb34cb7e3d71dc040fad53a64e3e.tar.gz minetest-c2e7b1f57941cb34cb7e3d71dc040fad53a64e3e.tar.bz2 minetest-c2e7b1f57941cb34cb7e3d71dc040fad53a64e3e.zip |
Derive NodeMetaRef from MetaDataRef
Diffstat (limited to 'src/script/lua_api/l_nodemeta.h')
-rw-r--r-- | src/script/lua_api/l_nodemeta.h | 35 |
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); |