aboutsummaryrefslogtreecommitdiff
path: root/src/config.h
blob: ae7d5ac266b90e639b0cc46e23c782ceed7faf0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#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 background;
    struct block hidden;
    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