Generated items

This commit is contained in:
MihailRis
2024-01-08 14:16:25 +03:00
parent e4f7b6d97c
commit dd5cd55aeb
5 changed files with 75 additions and 28 deletions
+7 -2
View File
@@ -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);