forked from Orpheon/Navmesh-Pathfinder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_types.h
64 lines (55 loc) · 989 Bytes
/
data_types.h
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
57
58
59
60
61
62
63
64
#ifndef DATA_TYPES_H_INCLUDED
#define DATA_TYPES_H_INCLUDED
#include <stdbool.h>
typedef struct Bitmask Bitmask;
typedef struct Point Point;
typedef struct Rect Rect;
typedef struct RectLinkedList RectLinkedList;
typedef struct Navmesh Navmesh;
typedef struct Character Character;
struct Bitmask
{
int width;
int height;
bool **mask;
};
struct Point
{
int x;
int y;
};
struct Rect
{
Point topleft;
Point topright;
Point bottomleft;
Point bottomright;
bool is_platform;
Rect **connections;
int num_connections;
// Pathfinding stuff
RectLinkedList *history;
double distance;
int activation;
};
struct RectLinkedList
{
RectLinkedList *next;
Rect *rect;
};
struct Navmesh
{
int num_rects;
RectLinkedList *list;
};
struct Character
{
double x;
double y;
double hs;
double vs;
double width;
double height;
double speed;
};
#endif // DATA_TYPES_H_INCLUDED