mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
Generated items
This commit is contained in:
parent
e4f7b6d97c
commit
dd5cd55aeb
5 changed files with 75 additions and 28 deletions
|
|
@ -18,10 +18,10 @@ enum class contenttype {
|
|||
none, block, item
|
||||
};
|
||||
|
||||
class contentindexreuse_error: public std::runtime_error {
|
||||
class namereuse_error: public std::runtime_error {
|
||||
contenttype type;
|
||||
public:
|
||||
contentindexreuse_error(const std::string& msg, contenttype type)
|
||||
namereuse_error(const std::string& msg, contenttype type)
|
||||
: std::runtime_error(msg), type(type) {}
|
||||
|
||||
inline contenttype getType() const {
|
||||
|
|
@ -36,9 +36,14 @@ class ContentBuilder {
|
|||
std::unordered_map<std::string, ItemDef*> itemDefs;
|
||||
std::vector<std::string> itemIds;
|
||||
public:
|
||||
~ContentBuilder();
|
||||
|
||||
void add(Block* def);
|
||||
void add(ItemDef* def);
|
||||
|
||||
Block* createBlock(std::string id);
|
||||
ItemDef* createItem(std::string id);
|
||||
|
||||
void checkIdentifier(std::string id);
|
||||
contenttype checkContentType(std::string id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue