Optimize GUECS a bit so that it automatically sets up the cell names and lel::Cell contents in the world, making it easier to work with.

This commit is contained in:
Zed A. Shaw 2025-02-22 22:27:56 -05:00
parent 2261e6f418
commit 389690e5c3
5 changed files with 7 additions and 11 deletions

View file

@ -12,6 +12,11 @@ namespace guecs {
void UI::layout(std::string grid) {
$grid = grid;
$parser.parse($grid);
for(auto& [name, cell] : $parser.cells) {
auto ent = entity(name);
$world.set<lel::Cell>(ent, cell);
}
}
DinkyECS::Entity UI::entity(std::string name) {