aboutsummaryrefslogtreecommitdiff
path: root/structs.h
blob: fa8982bf27bed0bec5cf406d36f2ac2bc28f9ea4 (plain) (blame)
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
#ifndef STRUCTS_H_
#define STRUCTS_H_

#include <stddef.h>

struct Position_s {
    size_t x;
    size_t y;
};
typedef struct Position_s Position;

enum MapTile_e {
    EMPTY = 0,
    WALL,
};

typedef enum MapTile_e MapTile;

enum Colors_e {
    EMPTY_COLOR = 1,
    VISITED_COLOR = 2,
    GOAL_COLOR = 3,
    WALL_COLOR = 4,
    START_COLOR = 5,
    PATH_COLOR = 6,
    FRONTIER_COLOR = 7,
    CURSOR_COLOR = 8,
};

/* A map is a 2D array of MapTiles. 
 * Use as map[row][column] */
typedef MapTile** Map;

struct PathNode_s {
    Position parent;
};
typedef struct PathNode_s PathNode;
typedef PathNode** Path;

#endif /* STRUCTS_H_ */