summaryrefslogtreecommitdiff
path: root/web/web_match.h
blob: c2a4d5a67c3755bd837a4e3207d9b13996be6ad0 (plain) (blame)
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
#ifndef WEB_MATCH_H
#define WEB_MATCH_H

#include "match.h"

struct match_state {
	int id;

	struct match *m;

	int num_darts;
};

struct match_opts_player {
	char *name;
	enum player_type type;
};

struct match_opts {
	struct match_opts_player *players;
	int num_players, size_players;
	int start_pts;
	int throws_first;
};

extern struct match_state *state;
extern struct match_opts *match_opts;

void match_new();
void free_state();
void match_opts_new();
void match_opts_add_player(enum player_type type, char *name);
void match_opts_remove_player(int pn);
void match_opts_free();

bool match_player_is_comp(int pn);

#endif