]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/nodedef.h
Fix key change menu a bit
[dragonfireclient.git] / src / nodedef.h
index e0b5c864c44a7dbc7ccd1bd19bc204a773be4311..fdf2f8c45b6e1d1525b4f8f81e88e2aa250d0e13 100644 (file)
@@ -253,6 +253,7 @@ class INodeDefManager
        virtual bool getId(const std::string &name, content_t &result) const=0;
        virtual content_t getId(const std::string &name) const=0;
        virtual const ContentFeatures& get(const std::string &name) const=0;
+       virtual std::string getAlias(const std::string &name) const =0;
        
        virtual void serialize(std::ostream &os)=0;
 };
@@ -270,6 +271,7 @@ class IWritableNodeDefManager : public INodeDefManager
        virtual content_t getId(const std::string &name) const=0;
        // If not found, returns the features of CONTENT_IGNORE
        virtual const ContentFeatures& get(const std::string &name) const=0;
+       virtual std::string getAlias(const std::string &name) const =0;
                
        // Register node definition
        virtual void set(content_t c, const ContentFeatures &def)=0;
@@ -279,6 +281,11 @@ class IWritableNodeDefManager : public INodeDefManager
                        const ContentFeatures &def)=0;
        // If returns CONTENT_IGNORE, could not allocate id
        virtual content_t allocateDummy(const std::string &name)=0;
+       // Set an alias so that nodes named <name> will load as <convert_to>.
+       // Alias is not set if <name> has already been defined.
+       // Alias will be removed if <name> is defined at a later point of time.
+       virtual void setAlias(const std::string &name,
+                       const std::string &convert_to)=0;
 
        /*
                Update tile textures to latest return values of TextueSource.