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:
parent
f21291211c
commit
562ac3bce9
21 changed files with 695 additions and 704 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue