aboutsummaryrefslogtreecommitdiff
path: root/src/itemdef.h
diff options
context:
space:
mode:
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