From c0f6395cf09f658eb95365c60f67b8a89104cb23 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Wed, 16 Nov 2011 13:03:28 +0200 Subject: Node definition names --- src/nodedef.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/nodedef.h') diff --git a/src/nodedef.h b/src/nodedef.h index a29626b10..055ed7a4b 100644 --- a/src/nodedef.h +++ b/src/nodedef.h @@ -253,6 +253,7 @@ public: // Get node definition virtual const ContentFeatures& get(content_t c) const=0; virtual const ContentFeatures& get(const MapNode &n) const=0; + virtual bool getId(const std::string &name, content_t &result) const=0; virtual void serialize(std::ostream &os)=0; }; @@ -266,10 +267,16 @@ public: // Get node definition virtual const ContentFeatures& get(content_t c) const=0; virtual const ContentFeatures& get(const MapNode &n) const=0; + virtual bool getId(const std::string &name, content_t &result) const=0; // Register node definition virtual void set(content_t c, const ContentFeatures &def)=0; - virtual ContentFeatures* getModifiable(content_t c)=0; + // Register node definition by name (allocate an id) + // If returns CONTENT_IGNORE, could not allocate id + virtual content_t set(const std::string &name, + const ContentFeatures &def)=0; + // If returns CONTENT_IGNORE, could not allocate id + virtual content_t allocateDummy(const std::string &name)=0; /* Update tile textures to latest return values of TextueSource. -- cgit v1.2.3