aboutsummaryrefslogtreecommitdiff
path: root/src/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h54
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