diff options
| author | Sopár Adrián <adrian.sopar@protonmail.com> | 2024-06-20 09:28:14 +0200 |
|---|---|---|
| committer | Sopár Adrián <adrian.sopar@protonmail.com> | 2024-06-20 09:28:14 +0200 |
| commit | 74ea6dc86646cee9915292d73d8c7afef01ef3e0 (patch) | |
| tree | 9a58866f7765dad8ba56f1f40b1fa031e9d2687d /src/config.h | |
First commit. This is mostly the state of the project as I left it around the end of 2019.HEADmaster
Diffstat (limited to 'src/config.h')
| -rw-r--r-- | src/config.h | 54 |
1 files changed, 54 insertions, 0 deletions
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 <stdlib.h> +#include <stdbool.h> +#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 |
