summaryrefslogtreecommitdiff
path: root/src/itemdef.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-02-28 19:45:23 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-03-10 11:28:12 +0200
commit562ac3bce9fae076562bd2e92e7d330c296ac1b0 (patch)
tree4b9421f1fd0a22a69cfa6320cc30f41f0f68af8a /src/itemdef.h
parentf21291211caaaa22ee5673adf46615dd46a36285 (diff)
downloadminetest-562ac3bce9fae076562bd2e92e7d330c296ac1b0.tar.gz
minetest-562ac3bce9fae076562bd2e92e7d330c296ac1b0.tar.bz2
minetest-562ac3bce9fae076562bd2e92e7d330c296ac1b0.zip
Digging time groups WIP
Diffstat (limited to 'src/itemdef.h')
-rw-r--r--src/itemdef.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/itemdef.h b/src/itemdef.h
index 5a432591d..15734ff44 100644
--- a/src/itemdef.h
+++ b/src/itemdef.h
@@ -25,8 +25,22 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <string>
#include <iostream>
#include <set>
+#include <map>
class IGameDef;
-struct ToolDiggingProperties;
+struct ToolCapabilities;
+
+/*
+ Some helpers
+*/
+
+static inline int itemgroup_get(const std::map<std::string, int> &groups,
+ const std::string &name)
+{
+ std::map<std::string, int>::const_iterator i = groups.find(name);
+ if(i == groups.end())
+ return 0;
+ return i->second;
+}
/*
Base item definition
@@ -63,7 +77,8 @@ struct ItemDefinition
bool usable;
bool liquids_pointable;
// May be NULL. If non-NULL, deleted by destructor
- ToolDiggingProperties *tool_digging_properties;
+ ToolCapabilities *tool_capabilities;
+ std::map<std::string, int> groups;
/*
Cached stuff