Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
itemgroup.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include <string>
8#include <unordered_map>
9
10typedef std::unordered_map<std::string, int> ItemGroupList;
11
12static inline int itemgroup_get(const ItemGroupList &groups, const std::string &name)
13{
14 ItemGroupList::const_iterator i = groups.find(name);
15 if (i == groups.end())
16 return 0;
17 return i->second;
18}
std::unordered_map< std::string, int > ItemGroupList
Definition itemgroup.h:10
static int itemgroup_get(const ItemGroupList &groups, const std::string &name)
Definition itemgroup.h:12