You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
823 B
43 lines
823 B
3 weeks ago
|
#pragma once
|
||
|
#include <string>
|
||
|
#include <unordered_map>
|
||
|
|
||
|
struct Cell {
|
||
|
int x = 0;
|
||
|
int y = 0;
|
||
|
int w = 0;
|
||
|
int h = 0;
|
||
|
int col = 0;
|
||
|
int row = 0;
|
||
|
bool left = true;
|
||
|
bool top = true;
|
||
|
bool expand = false;
|
||
|
|
||
|
Cell(int col, int row) : col(col), row(row) {}
|
||
|
};
|
||
|
|
||
|
struct LELParser {
|
||
|
int grid_x = 0;
|
||
|
int grid_y = 0;
|
||
|
int grid_w = 0;
|
||
|
int grid_h = 0;
|
||
|
int row_count = 0;
|
||
|
int max_columns = 0;
|
||
|
Cell cur;
|
||
|
std::unordered_map<std::string, Cell> cells;
|
||
|
|
||
|
LELParser(int x, int y, int width, int height);
|
||
|
void col();
|
||
|
void ltab();
|
||
|
void align(char dir);
|
||
|
void valign(char dir);
|
||
|
void id(std::string name);
|
||
|
void row();
|
||
|
void setwidth(int width);
|
||
|
void setheight(int height);
|
||
|
void expand();
|
||
|
void reset();
|
||
|
bool parse(std::string input);
|
||
|
void finalize();
|
||
|
};
|