mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
itemgroup.h and ItemGroupList typedef
This commit is contained in:
parent
0b21618a05
commit
07ed57476f
7 changed files with 17 additions and 28 deletions
|
@ -25,23 +25,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include <string>
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include "itemgroup.h"
|
||||
class IGameDef;
|
||||
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
|
||||
*/
|
||||
|
@ -78,7 +65,7 @@ struct ItemDefinition
|
|||
bool liquids_pointable;
|
||||
// May be NULL. If non-NULL, deleted by destructor
|
||||
ToolCapabilities *tool_capabilities;
|
||||
std::map<std::string, int> groups;
|
||||
ItemGroupList groups;
|
||||
|
||||
/*
|
||||
Cached stuff
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue