mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
Merge branch 'main' into heightmaps
This commit is contained in:
commit
9eea7243d5
5 changed files with 7 additions and 7 deletions
|
|
@ -106,14 +106,14 @@ public:
|
|||
ContentUnitDefs(UptrsMap<std::string, T> defs) : defs(std::move(defs)) {
|
||||
}
|
||||
|
||||
T* find(const std::string& id) const {
|
||||
const T* find(const std::string& id) const {
|
||||
const auto& found = defs.find(id);
|
||||
if (found == defs.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
return found->second.get();
|
||||
}
|
||||
T& require(const std::string& id) const {
|
||||
const T& require(const std::string& id) const {
|
||||
const auto& found = defs.find(id);
|
||||
if (found == defs.end()) {
|
||||
throw std::runtime_error("missing content unit " + id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue