Project

General

Profile

Statistics
| Revision:

root / proj / include / proj_structures.h @ 327

History | View | Annotate | Download (1.44 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
    float    host_x;
21
    float    host_y;
22
    float    host_angle;
23
    float    host_health;
24
    float    host_current_health;
25

    
26
    // remote
27
    float    remote_x;
28
    float    remote_y;
29
    float    remote_angle;
30
    float    remote_health;
31
    float    remote_current_health;
32

    
33
    // bullets
34
    uint8_t  no_bullets;
35
    float   *bullets_x;
36
    float   *bullets_y;
37
    float   *bullets_vx;
38
    float   *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 */