Project

General

Profile

Statistics
| Revision:

root / proj / include / proj_structures.h @ 313

History | View | Annotate | Download (1.29 KB)

1
#ifndef PROJ_STRUCTURES_H_INCLUDED
2
#define PROJ_STRUCTURES_H_INCLUDED
3

    
4
#include <stdint.h>
5

    
6
typedef struct keys {
7
    uint8_t w_pressed       : 1;
8
    uint8_t a_pressed       : 1;
9
    uint8_t s_pressed       : 1;
10
    uint8_t d_pressed       : 1;
11
    uint8_t ctrl_pressed    : 1;
12
    uint8_t plus_pressed    : 1;
13
    uint8_t minus_pressed   : 1;
14
    uint8_t lb_pressed      : 1;
15
} keys_t;
16

    
17
typedef struct __attribute__((packed)) {
18
    // host
19
    double  host_x;
20
    double  host_y;
21
    double  host_health;
22
    double  host_current_health;
23

    
24
    // remote
25
    double  remote_x;
26
    double  remote_y;
27
    double  remote_health;
28
    double  remote_current_health;
29

    
30
    // bullets
31
    size_t  no_bullets;
32
    double *bullets_x;
33
    double *bullets_y;
34
    double *bullets_vx;
35
    double *bullets_vy;
36
    bool   *bullets_shooter; // false for host, true for remote
37
} host_info_t;
38

    
39
typedef struct __attribute__((packed)) {
40
    keys_t  remote_keys_pressed;
41
    int32_t remote_mouse_x;
42
    int32_t remote_mouse_y;
43
    size_t  bullets_shot;
44
    double *bullets_x;
45
    double *bullets_y;
46
    double *bullets_angle;
47
} remote_info_t;
48

    
49
void host_info_dtor(host_info_t *p);
50

    
51
void remote_info_dtor(remote_info_t *p);
52

    
53
#endif /* end of include guard: PROJ_STRUCTURES_H_INCLUDED */