mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
World indices check
This commit is contained in:
parent
551b230b94
commit
636cb0c44c
12 changed files with 197 additions and 40 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue