-public:
- DiggingPropertiesList()
- {
- }
-
- void set(const std::string toolname,
- const DiggingProperties &prop)
- {
- m_digging_properties[toolname] = prop;
- }
-
- DiggingProperties get(const std::string toolname)
- {
- core::map<std::string, DiggingProperties>::Node *n;
- n = m_digging_properties.find(toolname);
- if(n == NULL)
- {
- // Not diggable by this tool, try to get defaults
- n = m_digging_properties.find("");
- if(n == NULL)
- {
- // Not diggable at all
- return DiggingProperties();
- }
- }
- // Return found properties
- return n->getValue();
- }
-
- void clear()
- {
- m_digging_properties.clear();
- }
-
-private:
- // toolname="": default properties (digging by hand)
- // Key is toolname
- core::map<std::string, DiggingProperties> m_digging_properties;