diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-12 07:59:47 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-12 07:59:47 +0100 |
commit | 0f68177a0384d41a7feff36cc0e1869b6d2ac9aa (patch) | |
tree | 4904b60820858efd0ee6ece0af1f2c1fc5846ec5 /src/crepe/manager/ComponentManager.cpp | |
parent | 73f8d5c558ebc0820ede241e64a876ff1c5ccefb (diff) | |
parent | 194ee3f192c3343c3ccc28dfa97fed180503ffd4 (diff) |
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/inputSystem
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; }); +} |