From 3face01a202040e4feff3b0936b4aa89c051c98d Mon Sep 17 00:00:00 2001 From: Dániel Juhász Date: Sat, 10 Feb 2018 22:04:16 +0200 Subject: Node definition manager refactor (#7016) * Rename IWritableNodeDefManager to NodeDefManager * Make INodeDefManager functions const * Use "const *NodeDefManager" instead of "*INodeDefManager" * Remove unused INodeDefManager class * Merge NodeDefManager and CNodeDefManager * Document NodeDefManager --- src/script/common/c_content.cpp | 4 ++-- src/script/common/c_content.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/script/common') diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 38e9411af..5229572f1 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -1075,7 +1075,7 @@ NodeBox read_nodebox(lua_State *L, int index) } /******************************************************************************/ -MapNode readnode(lua_State *L, int index, INodeDefManager *ndef) +MapNode readnode(lua_State *L, int index, const NodeDefManager *ndef) { lua_getfield(L, index, "name"); if (!lua_isstring(L, -1)) @@ -1099,7 +1099,7 @@ MapNode readnode(lua_State *L, int index, INodeDefManager *ndef) } /******************************************************************************/ -void pushnode(lua_State *L, const MapNode &n, INodeDefManager *ndef) +void pushnode(lua_State *L, const MapNode &n, const NodeDefManager *ndef) { lua_newtable(L); lua_pushstring(L, ndef->get(n).name.c_str()); diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index d5c375a8f..723253559 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -44,7 +44,7 @@ extern "C" { namespace Json { class Value; } struct MapNode; -class INodeDefManager; +class NodeDefManager; struct PointedThing; struct ItemStack; struct ItemDefinition; @@ -120,9 +120,9 @@ void read_inventory_list (lua_State *L, int tableindex, Server *srv, int forcesize=-1); MapNode readnode (lua_State *L, int index, - INodeDefManager *ndef); + const NodeDefManager *ndef); void pushnode (lua_State *L, const MapNode &n, - INodeDefManager *ndef); + const NodeDefManager *ndef); void read_groups (lua_State *L, int index, -- cgit v1.2.3