aboutsummaryrefslogtreecommitdiff
path: root/dat.h
blob: 643216e6296cef007fd805f85315ea9f52b81c24 (plain)
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
typedef struct GameState GameState;
typedef struct Derivative Derivative;
typedef struct Conn Conn;
typedef struct Player Player;
typedef struct Lobby Lobby;
typedef struct Party Party;

struct GameState
{
	double x, v;
};

struct Derivative
{
	double dx, dv;
};

struct Conn
{
	char dir[40];
	int ctl;
	int data;
};

struct Player
{
	char *name;
	Conn conn;
};

struct Lobby
{
	Player *seats;
	ulong nseats;
	ulong cap;

	int (*takeseat)(Lobby*, char*, int, int);
	int (*leaveseat)(Lobby*, ulong);
	int (*getcouple)(Lobby*, Player*);
	void (*healthcheck)(Lobby*);
};

struct Party
{
	Player players[2];	/* the needle and the wedge */
	Party *prev, *next;
};

extern Party theparty;