World indices check

This commit is contained in:
MihailRis
2023-12-07 15:16:37 +03:00
parent 551b230b94
commit 636cb0c44c
12 changed files with 197 additions and 40 deletions
+9 -1
View File
@@ -64,7 +64,15 @@ Content::~Content() {
delete indices;
}
Block* Content::require(std::string id) const {
Block* Content::findBlock(string id) const {
auto found = blockDefs.find(id);
if (found == blockDefs.end()) {
return nullptr;
}
return found->second;
}
Block* Content::requireBlock(string id) const {
auto found = blockDefs.find(id);
if (found == blockDefs.end()) {
throw std::runtime_error("missing block "+id);