From 3face01a202040e4feff3b0936b4aa89c051c98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Juh=C3=A1sz?= 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/server.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/server.h') diff --git a/src/server.h b/src/server.h index ae7511bdf..b5db04c8a 100644 --- a/src/server.h +++ b/src/server.h @@ -45,7 +45,7 @@ class ChatEvent; struct ChatEventChat; struct ChatInterface; class IWritableItemDefManager; -class IWritableNodeDefManager; +class NodeDefManager; class IWritableCraftDefManager; class BanManager; class EventManager; @@ -256,7 +256,7 @@ public: // IGameDef interface // Under envlock virtual IItemDefManager* getItemDefManager(); - virtual INodeDefManager* getNodeDefManager(); + virtual const NodeDefManager* getNodeDefManager(); virtual ICraftDefManager* getCraftDefManager(); virtual u16 allocateUnknownNodeId(const std::string &name); virtual MtEventManager* getEventManager(); @@ -264,7 +264,7 @@ public: virtual EmergeManager *getEmergeManager() { return m_emerge; } IWritableItemDefManager* getWritableItemDefManager(); - IWritableNodeDefManager* getWritableNodeDefManager(); + NodeDefManager* getWritableNodeDefManager(); IWritableCraftDefManager* getWritableCraftDefManager(); virtual const std::vector &getMods() const { return m_mods; } @@ -366,7 +366,8 @@ private: void SendDeathscreen(session_t peer_id, bool set_camera_point_target, v3f camera_point_target); void SendItemDef(session_t peer_id, IItemDefManager *itemdef, u16 protocol_version); - void SendNodeDef(session_t peer_id, INodeDefManager *nodedef, u16 protocol_version); + void SendNodeDef(session_t peer_id, const NodeDefManager *nodedef, + u16 protocol_version); /* mark blocks not sent for all clients */ void SetBlocksNotSent(std::map& block); @@ -544,7 +545,7 @@ private: IWritableItemDefManager *m_itemdef; // Node definition manager - IWritableNodeDefManager *m_nodedef; + NodeDefManager *m_nodedef; // Craft definition manager IWritableCraftDefManager *m_craftdef; -- cgit v1.2.3