mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 13:31:49 +00:00
Merge branch 'main' into heightmaps
This commit is contained in:
commit
f2395dede8
9 changed files with 256 additions and 34 deletions
|
|
@ -45,6 +45,14 @@ public:
|
|||
defs[id] = std::make_unique<T>(id);
|
||||
return *defs[id];
|
||||
}
|
||||
// Only fetch existing definition, return null otherwise.
|
||||
T* get(const std::string& id) {
|
||||
auto found = defs.find(id);
|
||||
if (found != defs.end()) {
|
||||
return &*found->second;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto build() {
|
||||
return std::move(defs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue