-
Notifications
You must be signed in to change notification settings - Fork 18
/
simulation.h
77 lines (66 loc) · 1.36 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
68
69
70
71
72
73
74
75
76
77
#ifndef _SIMULATION_H_
#define _SIMULATION_H_
#include "vector.h"
#define MODE_PLAYING 0
#define MODE_BOARD 1
typedef struct
{
Vec2d position;
Vec2d speed;
Vec2d acceleration;
int live;
int leftSource;
int stale;
} SimMissile;
typedef struct
{
Vec2f* dot;
SimMissile missile;
int length;
int player;
double angle;
double velocity;
} SimShot;
typedef struct
{
SimShot* shot;
int currentShot;
Vec2d position;
double angle;
double velocity;
double energy;
int deaths;
int kills;
int active;
int valid;
char name[16];
int extrapoints;
int framesalive;
} SimPlayer;
typedef struct
{
Vec2d position;
double radius;
double mass;
} SimPlanet;
void playerJoin(int p);
void playerLeave(int p);
void updateAngle(int p, double a, int ce);
void updateVelocity(int p, double v);
void updateName(int p, char* n);
void tankEnergy(int p);
void clearTraces(int p);
void reinitialize(void);
SimShot* getShot(int p, int s);
SimPlanet* getPlanet(int i);
SimPlayer* getPlayer(int p);
double getFlash(void);
void initSimulation(void);
void stepSimulation(void);
void stepExtrapoints(int timeRemain);
double getGPot(int x, int y);
double getPmin(void);
double getPmax(void);
int getTimeRemain(void);
int getMode(void);
#endif /* _SIMULATION_H_ */