From 74ea6dc86646cee9915292d73d8c7afef01ef3e0 Mon Sep 17 00:00:00 2001 From: Sopár Adrián Date: Thu, 20 Jun 2024 09:28:14 +0200 Subject: First commit. This is mostly the state of the project as I left it around the end of 2019. --- src/config.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/config.h (limited to 'src/config.h') diff --git a/src/config.h b/src/config.h new file mode 100644 index 0000000..6ee5a47 --- /dev/null +++ b/src/config.h @@ -0,0 +1,54 @@ +#ifndef H_MAZE_CONFIG +#define H_MAZE_CONFIG + +#include +#include +#include "game/operations.h" + +struct binding +{ + wchar_t c; + char cname[5]; + enum op_res (*operation)(struct game_state *, int); + int param; +}; + +struct block +{ + wchar_t chr; + bool bold; + short color; +}; + +struct game_blocks +{ + struct block wall; + struct block road; + struct block path; + struct block solve; + struct block player; + struct block start; + struct block target; +}; + +struct conf +{ + struct binding *bindings; + struct game_blocks blocks; + size_t count; +}; + +static inline struct block get_block(wchar_t chr, bool bold, short color) +{ + struct block result; + result.chr = chr; + result.bold = bold; + result.color = color; + return result; +} + +struct conf *load_default_conf(); + +void destroy_conf(struct conf *); + +#endif \ No newline at end of file -- cgit v1.2.3