VOX
A little voxel engine
Loading...
Searching...
No Matches
Item.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "define.hpp"
4#include "Block.hpp"
5
6#include <cstdint>
7
9{
10
11public:
12
13 enum class Type : uint16_t
14 {
24 None
25
26 } const type = Type::None;
27
29 uint64_t mesh_id = 0;
30
31private:
32
33};
34
36{
37
38public:
39
41 {
42 static ItemsInfo instance;
43 return instance;
44 }
45
47 {
48 return m_info[static_cast<size_t>(type)];
49 }
50
51 ItemInfo & get(const size_t index)
52 {
53 return m_info[index];
54 }
55
56 size_t count() const
57 {
58 return m_info.size();
59 }
60
61private:
62
63 std::vector<ItemInfo> m_info;
64
65 ItemsInfo();
66};
67
68extern ItemsInfo & g_items_info;
ItemsInfo & g_items_info
Definition: Item.cpp:3
Type
Definition: Block.hpp:33
Definition: Item.hpp:9
Type
Definition: Item.hpp:14
const BlockInfo::Type block_id
Definition: Item.hpp:28
uint64_t mesh_id
Definition: Item.hpp:29
enum ItemInfo::Type type
Definition: Item.hpp:36
static ItemsInfo & getInstance()
Definition: Item.hpp:40
ItemInfo & get(const size_t index)
Definition: Item.hpp:51
size_t count() const
Definition: Item.hpp:56
ItemInfo & get(const ItemInfo::Type type)
Definition: Item.hpp:46