-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.c
37 lines (31 loc) · 1.11 KB
/
test.c
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
#include "grid-aoi.h"
void test_aoi() {
aoi_contextptr context = aoi_new(1000.0f, 1000.0f, 20, 1);
struct int_valuevec enter_self, enter_other, view_list, leave_other;
valuevec_init(&enter_self);
valuevec_init(&enter_other);
valuevec_init(&view_list);
valuevec_init(&leave_other);
aoi_enter(context, 1, 1, 1, 1, 0xFFFF, &enter_self, &enter_other);
valuevec_clear(&enter_self);
valuevec_clear(&enter_other);
aoi_enter(context, 2, 1, 1, 1, 0xFFFF, &enter_self, &enter_other);
valuevec_clear(&enter_self);
valuevec_clear(&enter_other);
aoi_enter(context, 3, 1, 1, 1, 0xFFFF, &enter_self, &enter_other);
valuevec_clear(&enter_self);
valuevec_clear(&enter_other);
aoi_enter(context, 4, 100, 100, 1, 0xFFFF, &enter_self, &enter_other);
valuevec_clear(&enter_self);
valuevec_clear(&enter_other);
aoi_move(context, 1, 100, 100, &enter_self, &enter_other);
aoi_viewlist(context, 2, &view_list);
valuevec_clear(&view_list);
aoi_leave(context, 3, &leave_other);
aoi_viewlist(context, 2, &view_list);
aoi_delete(context);
}
int main(int argc, char** argv) {
test_aoi();
printf("Finished\n");
}