From 562ac3bce9fae076562bd2e92e7d330c296ac1b0 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 28 Feb 2012 19:45:23 +0200 Subject: Digging time groups WIP --- src/itemdef.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/itemdef.h') 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 #include #include +#include class IGameDef; -struct ToolDiggingProperties; +struct ToolCapabilities; + +/* + Some helpers +*/ + +static inline int itemgroup_get(const std::map &groups, + const std::string &name) +{ + std::map::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 groups; /* Cached stuff -- cgit v1.2.3