blob: 2b2496a1fa63e2907f12798db0908b846b678dd0 (
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
|
#include <u.h>
#include <libc.h>
#include <draw.h>
#include "libgeometry/geometry.h"
#include "dat.h"
#include "fns.h"
Party theparty;
void
inittheparty(void)
{
theparty.next = theparty.prev = &theparty;
}
Party *
newparty(Player *players)
{
Party *p;
p = emalloc(sizeof(Party));
p->players[0] = players[0];
p->players[1] = players[1];
p->u = newuniverse();
addparty(p);
return p;
}
void
delparty(Party *p)
{
p->next->prev = p->prev;
p->prev->next = p->next;
deluniverse(p->u);
free(p);
}
void
addparty(Party *p)
{
p->prev = theparty.prev;
p->next = &theparty;
theparty.prev->next = p;
theparty.prev = p;
}
|