diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-21 02:03:13 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-21 02:03:35 -0700 |
commit | 7797f45a97681ca513cb75a7e6a322be3ec5003a (patch) | |
tree | b8b3e4e8a6482064aab345f82469ebcafeba0d9f /web/web_match.h | |
parent | dc7c6379f0ef9db382a5445954a4be37e2ec5640 (diff) | |
download | dartboat-7797f45a97681ca513cb75a7e6a322be3ec5003a.tar.gz dartboat-7797f45a97681ca513cb75a7e6a322be3ec5003a.tar.xz |
web: remove hard-coded match modes
Diffstat (limited to 'web/web_match.h')
-rw-r--r-- | web/web_match.h | 24 |
1 files changed, 9 insertions, 15 deletions
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(); |