mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-22 02:19:44 +00:00
fix content inheritance issues
This commit is contained in:
parent
8124b550df
commit
c9cc301e46
10 changed files with 55 additions and 22 deletions
|
|
@ -38,16 +38,21 @@ public:
|
|||
T& create(const std::string& id, bool* created = nullptr) {
|
||||
auto found = defs.find(id);
|
||||
if (found != defs.end()) {
|
||||
if (created) *created = false;
|
||||
if (created) {
|
||||
*created = false;
|
||||
}
|
||||
return *found->second;
|
||||
}
|
||||
if (created) *created = true;
|
||||
if (created) {
|
||||
*created = true;
|
||||
}
|
||||
checkIdentifier(id);
|
||||
allNames[id] = type;
|
||||
names.push_back(id);
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue