From 7797f45a97681ca513cb75a7e6a322be3ec5003a Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 21 May 2022 02:03:13 -0700 Subject: web: remove hard-coded match modes --- web/web_match.h | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'web/web_match.h') diff --git a/web/web_match.h b/web/web_match.h index fc2dabe..0a5a71d 100644 --- a/web/web_match.h +++ b/web/web_match.h @@ -3,17 +3,6 @@ #include "match.h" -enum match_mode { - M_FIRST = 1, - M_PVC = M_FIRST, - M_P, - M_PVP, - M_CVC, - M_PVPVP, - M_PVCVCVC, - M_LAST = M_PVCVCVC -}; - enum player_type { PT_USER, PT_COMP @@ -21,7 +10,6 @@ enum player_type { struct match_state { int id; - enum match_mode mode; struct leg **legs; enum player_type *player_types; @@ -32,10 +20,14 @@ struct match_state { int num_darts; }; +struct match_opts_player { + char *name; + enum player_type type; +}; + struct match_opts { - enum match_mode mode; - enum player_type p1_type, p2_type; - char *p1_name, *p2_name; + struct match_opts_player *players; + int num_players, size_players; int start_pts; int throws_first; }; @@ -46,6 +38,8 @@ extern struct match_opts *match_opts; void match_new(); void match_add_player(int start_pts, enum player_type type, char *name); void free_state(); +void match_opts_new(); +void match_opts_add_player(enum player_type type, char *name); void match_opts_free(); struct leg *state_active_leg(); -- cgit v1.2.3-70-g09d2