- // This usually is the CONTENT_ value
- virtual u16 typeId() const = 0;
- virtual NodeMetadata* clone() = 0;
- virtual void serializeBody(std::ostream &os) = 0;
- virtual std::string infoText() {return "";}
- virtual Inventory* getInventory() {return NULL;}
- // This is called always after the inventory is modified, before
- // the changes are copied elsewhere
- virtual void inventoryModified(){}
- // A step in time. Returns true if metadata changed.
- virtual bool step(float dtime) {return false;}
- virtual bool nodeRemovalDisabled(){return false;}
- // Used to make custom inventory menus.
- // See format in guiInventoryMenu.cpp.
- virtual std::string getInventoryDrawSpecString(){return "";}
- // primarily used for locking chests, but others can play too
- virtual std::string getOwner(){ return std::string(""); }
- virtual void setOwner(std::string t){ }
-
-protected:
- static void registerType(u16 id, Factory f);
+ void clear();
+
+ // Generic key/value store
+ std::string getString(const std::string &name, unsigned short recursion = 0) const;
+ void setString(const std::string &name, const std::string &var);
+ // Support variable names in values
+ std::string resolveString(const std::string &str, unsigned short recursion = 0) const;
+ std::map<std::string, std::string> getStrings() const
+ {
+ return m_stringvars;
+ }
+
+ // The inventory
+ Inventory* getInventory()
+ {
+ return m_inventory;
+ }
+