forked from ripwu/BehaviourTree.C
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbt.h
More file actions
37 lines (30 loc) · 858 Bytes
/
Copy pathbt.h
File metadata and controls
37 lines (30 loc) · 858 Bytes
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
typedef void (*NODE_OPERATION)(void *node);
struct node_operations
{
NODE_OPERATION running;
NODE_OPERATION success;
NODE_OPERATION fail;
};
typedef void (*NODE_CALLBACK)(void *node, void *object, struct node_operations *ops);
struct node_callbacks
{
NODE_CALLBACK enter;
NODE_CALLBACK tick;
NODE_CALLBACK exit;
};
enum BRANCH_TYPE
{
BRANCH_TYPE_BEGIN = 0,
BRANCH_TYPE_SEQUENCE = BRANCH_TYPE_BEGIN,
BRANCH_TYPE_PRIORITY,
BRANCH_TYPE_RANDOM,
BRANCH_TYPE_COUNT,
};
void behaviourtree_init();
void *node_create(struct node_callbacks *cbs, void *blackboard);
void *node_control(void *node);
void *node_blackboard(void *node);
void *branch_create(int type, int num, void **nodes);
void *behaviourtree_create(void *branch);
void behaviourtree_release(void *bt);
void behaviourtree_tick(void *bt, void *object);