I need a way to ask if a cell exists for more dynamic layouts.
This commit is contained in:
parent
aff0fb839c
commit
25e3935170
3 changed files with 6 additions and 1 deletions
|
|
@ -68,6 +68,7 @@ namespace guecs {
|
||||||
sf::Vector2f get_size();
|
sf::Vector2f get_size();
|
||||||
void layout(const string& grid);
|
void layout(const string& grid);
|
||||||
Entity init_entity(const string& name);
|
Entity init_entity(const string& name);
|
||||||
|
bool contains(const string& name);
|
||||||
Entity entity(const string& name);
|
Entity entity(const string& name);
|
||||||
Entity entity(const string& name, int id);
|
Entity entity(const string& name, int id);
|
||||||
const std::string& name_for(Entity gui_id);
|
const std::string& name_for(Entity gui_id);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
# HEY BUG: when you have a . spec in a LEL it doesn't work on text
|
# HEY BUG: when you have a . spec in a LEL it doesn't work on text
|
||||||
|
|
||||||
project('lel-guecs', 'cpp',
|
project('lel-guecs', 'cpp',
|
||||||
version: '0.7.1',
|
version: '0.7.2',
|
||||||
default_options: [
|
default_options: [
|
||||||
'cpp_std=c++23',
|
'cpp_std=c++23',
|
||||||
'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1',
|
'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1',
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,10 @@ namespace guecs {
|
||||||
return $ents_name.at(gui_id);
|
return $ents_name.at(gui_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UI::contains(const string& name) {
|
||||||
|
return $name_ents.contains(name);
|
||||||
|
}
|
||||||
|
|
||||||
Entity UI::entity(const string& name) {
|
Entity UI::entity(const string& name) {
|
||||||
assert($name_ents.contains(name) &&
|
assert($name_ents.contains(name) &&
|
||||||
"GUECS entity does not exist. Mispelled cell name?");
|
"GUECS entity does not exist. Mispelled cell name?");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue