forked from xiexun162534/Labyrinth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.h
More file actions
56 lines (40 loc) · 1.04 KB
/
map.h
File metadata and controls
56 lines (40 loc) · 1.04 KB
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 __MAP_H
#define __MAP_H
#define LAND 0
#define ROAD 1
#define WALL 2
#define ENTRANCE 3
#define EXIT 4
#define LEFT 0
#define RIGHT 1
#define UP 2
#define DOWN 3
#define TOTAL_DIRECTIONS 4
typedef struct __COORDINATE
{
int x;
int y;
} coordinate;
typedef struct __LAND
{
int type;
unsigned long int timestamp;
} land;
typedef struct __MAP
{
int width;
int height;
coordinate entrance_position;
coordinate exit_position;
land *data;
} map;
map *create_empty_map (int width, int height);
unsigned long int get_land_timestamp (map *labyrinth, coordinate position);
void set_land_timestamp (map *labyrinth, coordinate position, unsigned long int timestamp);
int get_land_type (map *labyrinth, coordinate position);
void set_land_type (map *labyrinth, coordinate position, int type);
void set_entrance (map *labyrinth, coordinate entrance_position);
void set_exit (map *labyrinth, coordinate exit_position);
coordinate get_adjacent (coordinate position, int direction);
int is_in_map (map *labyrinth, coordinate position);
#endif