1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Digging time groups WIP

This commit is contained in:
Perttu Ahola 2012-02-28 19:45:23 +02:00
parent f21291211c
commit 562ac3bce9
21 changed files with 695 additions and 704 deletions

View file

@ -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