diff --git a/include/guecs/ui.hpp b/include/guecs/ui.hpp index c6c1fa0..5d6ad73 100644 --- a/include/guecs/ui.hpp +++ b/include/guecs/ui.hpp @@ -68,6 +68,7 @@ namespace guecs { sf::Vector2f get_size(); void layout(const string& grid); Entity init_entity(const string& name); + bool contains(const string& name); Entity entity(const string& name); Entity entity(const string& name, int id); const std::string& name_for(Entity gui_id); diff --git a/meson.build b/meson.build index 9e3b5bc..4f0c701 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ # HEY BUG: when you have a . spec in a LEL it doesn't work on text project('lel-guecs', 'cpp', - version: '0.7.1', + version: '0.7.2', default_options: [ 'cpp_std=c++23', 'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1', diff --git a/src/guecs/ui.cpp b/src/guecs/ui.cpp index 75ff28a..49810a9 100644 --- a/src/guecs/ui.cpp +++ b/src/guecs/ui.cpp @@ -51,6 +51,10 @@ namespace guecs { return $ents_name.at(gui_id); } + bool UI::contains(const string& name) { + return $name_ents.contains(name); + } + Entity UI::entity(const string& name) { assert($name_ents.contains(name) && "GUECS entity does not exist. Mispelled cell name?");