summaryrefslogtreecommitdiffstats
path: root/src/game.c
blob: f5917813589649e3e24cdf59a5836b3423cd85f3 (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
#include <stdlib.h>

#include "game.h"
#include "player.h"

struct game *
new_game(void)
{
	struct game *g;

	g = malloc(sizeof(*g));
	if (g == NULL) {
		return NULL;
	}

	g->players[0] = new_player();
	g->players[1] = new_player();

	return g;
}

void
free_game(struct game *g)
{
	free_player(g->players[0]);
	free_player(g->players[1]);

	free(g);
}