#ifndef WEB_MATCH_H #define WEB_MATCH_H #include "match.h" enum match_mode { M_FIRST = 1, M_PVC = M_FIRST, M_P, M_PVP, M_LAST = M_PVP }; struct match_state { enum match_mode mode; struct leg *legs[2]; int active_player; int boat_undone; int num_darts; }; struct match_opts { enum match_mode mode; char *p1_name, *p2_name; int start_pts; int throws_first; }; extern struct match_state *state; extern struct match_opts *match_opts; void free_state(); void match_opts_free(); struct leg *state_active_leg(); int match_num_players(); int match_winning_player(); bool match_is_over(); int match_prev_player(); int match_next_player(); int match_prev_throw_player(); bool match_player_is_comp(int pn); bool match_first_user_has_thrown(); #endif