diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-11 14:21:34 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-11 14:21:34 +0100 |
commit | e6a5bb579d0969245f34119ef2489f47039c523e (patch) | |
tree | e8b0b922cd28d6f83d7bf59ea1b69bbb84d0fd04 /src/crepe/manager/ComponentManager.cpp | |
parent | 7b8de90699aea153e73b5f2cee05c69b966b81be (diff) | |
parent | 78c4a8772526f40c531b5402b56932b0a41e22e8 (diff) |
Merge branch 'master' into niels/remove_singleton
Diffstat (limited to 'src/crepe/manager/ComponentManager.cpp')
-rw-r--r-- | src/crepe/manager/ComponentManager.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/crepe/manager/ComponentManager.cpp b/src/crepe/manager/ComponentManager.cpp index 80cf8b4..df30d27 100644 --- a/src/crepe/manager/ComponentManager.cpp +++ b/src/crepe/manager/ComponentManager.cpp @@ -1,4 +1,5 @@ #include "../api/GameObject.h" +#include "../api/Metadata.h" #include "../types.h" #include "../util/Log.h" @@ -61,3 +62,13 @@ GameObject ComponentManager::new_object(const string & name, const string & tag, void ComponentManager::set_persistent(game_object_id_t id, bool persistent) { this->persistent[id] = persistent; } + +set<game_object_id_t> ComponentManager::get_objects_by_name(const string & name) const { + return this->get_objects_by_predicate<Metadata>( + [name](const Metadata & data) { return data.name == name; }); +} + +set<game_object_id_t> ComponentManager::get_objects_by_tag(const string & tag) const { + return this->get_objects_by_predicate<Metadata>( + [tag](const Metadata & data) { return data.tag == tag; }); +} |