From dc5319b6c9f2e39d93f2fa881403f36fc47ffaac Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 17 Jun 2011 22:20:15 +0300 Subject: Moved some mapnode content stuff from mapnode.{h,cpp} and digging property stuff from material.cpp to content_mapnode.{h,cpp} --- src/materials.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/materials.h') diff --git a/src/materials.h b/src/materials.h index 422149753..272116d83 100644 --- a/src/materials.h +++ b/src/materials.h @@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "common_irrlicht.h" -#include "inventory.h" #include struct DiggingProperties @@ -49,20 +48,26 @@ struct DiggingProperties u16 wear; }; -class MaterialProperties +/* + This is a DEPRECATED way of determining mining characteristics. + TODO: Get rid of this and set up some attributes like toughness, + fluffyness, and a funciton to calculate time and durability loss + (and sound? and whatever else) from them +*/ +class DiggingPropertiesList { public: - MaterialProperties() + DiggingPropertiesList() { } - void setDiggingProperties(const std::string toolname, + void set(const std::string toolname, const DiggingProperties &prop) { m_digging_properties[toolname] = prop; } - DiggingProperties getDiggingProperties(const std::string toolname) + DiggingProperties get(const std::string toolname) { core::map::Node *n; n = m_digging_properties.find(toolname); @@ -80,16 +85,17 @@ public: return n->getValue(); } + void clear() + { + m_digging_properties.clear(); + } + private: // toolname="": default properties (digging by hand) // Key is toolname core::map m_digging_properties; }; -void initializeMaterialProperties(); - -// Material correspond to the CONTENT_* constants -MaterialProperties * getMaterialProperties(u8 material); // For getting the default properties, set tool="" DiggingProperties getDiggingProperties(u8 material, const std::string &tool); -- cgit v1.2.3 From 6378a71ea5f3f97316d38c114de0fc207e18f940 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 17 Jun 2011 23:28:25 +0300 Subject: Updated comments --- src/materials.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/materials.h') diff --git a/src/materials.h b/src/materials.h index 272116d83..f061ecbfa 100644 --- a/src/materials.h +++ b/src/materials.h @@ -49,7 +49,7 @@ struct DiggingProperties }; /* - This is a DEPRECATED way of determining mining characteristics. + This is a bad way of determining mining characteristics. TODO: Get rid of this and set up some attributes like toughness, fluffyness, and a funciton to calculate time and durability loss (and sound? and whatever else) from them -- cgit v1.2.3