1
0
Fork 0
Univerxel/src/world/Voxel.hpp

19 lines
395 B
C++
Raw Normal View History

2020-07-10 17:49:16 +00:00
#pragma once
2020-07-25 14:29:05 +00:00
#include <map>
2020-07-10 17:49:16 +00:00
struct Voxel {
unsigned char Density;
unsigned short Material;
2020-07-25 14:29:05 +00:00
};
struct Item {
unsigned long long Count;
unsigned short Material;
};
struct ItemList: std::map<unsigned short, unsigned long long> {
void add(const std::optional<Item>& item) {
if(item) {
(*this)[item.value().Material] += item.value().Count;
}
}
2020-07-10 17:49:16 +00:00
};