I now have a semi-functional GUI system that uses the ECS style to build gui elements rather than inheritance.

This commit is contained in:
Zed A. Shaw 2025-02-18 01:10:56 -05:00
parent 615599084a
commit 46de98e6f4
12 changed files with 213 additions and 146 deletions

10
lel.hpp
View file

@ -6,7 +6,6 @@
#include <vector>
namespace lel {
using Row = std::vector<std::string>;
struct Cell {
int x = 0;
@ -26,8 +25,12 @@ namespace lel {
bool percent = false;
Cell(int col, int row) : col(col), row(row) {}
Cell() {}
};
using Row = std::vector<std::string>;
using CellMap = std::unordered_map<std::string, Cell>;
struct Parser {
int grid_x = 0;
int grid_y = 0;
@ -35,9 +38,12 @@ namespace lel {
int grid_h = 0;
Cell cur;
std::vector<Row> grid;
std::unordered_map<std::string, Cell> cells;
CellMap cells;
Parser(int x, int y, int width, int height);
Parser();
void position(int x, int y, int width, int height);
void id(std::string name);
void reset();
bool parse(std::string input);