forked from Draradech/NewtonWars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simulation.h
67 lines (58 loc) · 1.17 KB
/
simulation.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef _SIMULATION_H_
#define _SIMULATION_H_
#include "vector.h"
typedef struct
{
Vec2d position;
Vec2d speed;
int live;
int leftSource;
} SimMissile;
typedef struct
{
Vec2f* dot;
SimMissile missile;
int length;
int player;
} SimShot;
typedef struct
{
SimShot* shot;
int currentShot;
Vec2d position;
double angle;
double velocity;
double oldVelocity;
int deaths;
int kills;
int shots;
int active;
int valid;
int didShoot;
int timeout;
int timeoutcnt;
char name[16];
} SimPlayer;
typedef struct
{
Vec2d position;
double radius;
double mass;
} SimPlanet;
void playerJoin(int p);
void playerLeave(int p);
void updateAngle(int p, double a);
void validateOld(int p);
void updateVelocity(int p, double v);
void updateName(int p, char* n);
void clearTraces(int p);
void reinitialize(void);
SimShot* getShot(int p, int s);
SimPlanet* getPlanet(int i);
SimPlayer* getPlayer(int p);
double getFlash(void);
int getCurrentPlayer(void);
int getDeathMessage(char* buf);
void initSimulation(void);
void stepSimulation(void);
#endif /* _SIMULATION_H_ */