root / proj / include / proj_structures.h @ 331
History | View | Annotate | Download (1.47 KB)
1 |
#ifndef PROJ_STRUCTURES_H_INCLUDED
|
---|---|
2 |
#define PROJ_STRUCTURES_H_INCLUDED
|
3 |
|
4 |
#include <stdint.h> |
5 |
#include "ent.h" |
6 |
|
7 |
typedef struct keys { |
8 |
uint8_t w_pressed : 1;
|
9 |
uint8_t a_pressed : 1;
|
10 |
uint8_t s_pressed : 1;
|
11 |
uint8_t d_pressed : 1;
|
12 |
uint8_t ctrl_pressed : 1;
|
13 |
uint8_t plus_pressed : 1;
|
14 |
uint8_t minus_pressed : 1;
|
15 |
uint8_t lb_pressed : 1;
|
16 |
} keys_t; |
17 |
|
18 |
typedef struct { |
19 |
// host
|
20 |
int16_t host_x; |
21 |
int16_t host_y; |
22 |
int16_t host_angle; |
23 |
int16_t host_health; |
24 |
int16_t host_current_health; |
25 |
|
26 |
// remote
|
27 |
int16_t remote_x; |
28 |
int16_t remote_y; |
29 |
int16_t remote_angle; |
30 |
int16_t remote_health; |
31 |
int16_t remote_current_health; |
32 |
|
33 |
// bullets
|
34 |
uint8_t no_bullets; |
35 |
int16_t *bullets_x; |
36 |
int16_t *bullets_y; |
37 |
int16_t *bullets_vx; |
38 |
int16_t *bullets_vy; |
39 |
bool *bullets_shooter; // false for host, true for remote |
40 |
} host_info_t; |
41 |
|
42 |
typedef struct { |
43 |
keys_t remote_keys_pressed; |
44 |
double remote_angle;
|
45 |
} remote_info_t; |
46 |
|
47 |
typedef struct { |
48 |
bool new_bullet;
|
49 |
} bullet_info_t; |
50 |
|
51 |
host_info_t* host_info_ctor(gunner_t *host, gunner_t *remote); |
52 |
|
53 |
void host_info_dtor(host_info_t *p);
|
54 |
|
55 |
remote_info_t* remote_info_ctor(void);
|
56 |
|
57 |
void remote_info_dtor(remote_info_t *p);
|
58 |
|
59 |
bullet_info_t* bullet_info_ctor(void);
|
60 |
|
61 |
void bullet_info_dtor(bullet_info_t *p);
|
62 |
|
63 |
#endif /* end of include guard: PROJ_STRUCTURES_H_INCLUDED */ |