#pragma once #include #include #include #include #include #include #include using std::deque; using std::string; using std::array; using std::vector; #define FPS 15 #define SCREEN 800 #define LINE_W 2 #define IMG_COUNT 2 #define BACKGROUND WHITE #define GHOST BLACK #define GRID BLACK enum tile {empty = 0, p1 = 1, p2 = 2, tie = 3}; #define OKAY -1 #define CHANGE -2 tile act(int t); tile pas(int t); Color col(int t); struct Block { tile t = empty; int depth; Rectangle place; array sons; Block() {} Block(int _depth, Rectangle trg); int set(tile pl); bool playable(deque v); int play(deque v, tile pl); tile update(); void update_rect(Rectangle trg); Rectangle get_rect(deque v); Rectangle get_son_rect(int son); }; bool valid(Block* root, Rectangle play_area, deque &turn); class Renderer { array textures; Block *root; void prepareTextures(); public: Renderer(Block* root, int time, Rectangle dst); void render_image(tile t, Rectangle dst, Color color = WHITE); void render_all(Block* root, int time, Rectangle play_area, deque highlight = {}); void render_block(Block *b); int update_board_size(int depth); };