From 85c101979a181a76e6250fb1abb75216e08384a3 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 23 May 2022 23:15:34 -0700 Subject: move more match logic from web to lib --- web/web_match.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'web/web_match.c') diff --git a/web/web_match.c b/web/web_match.c index d4dac50..93ebf76 100644 --- a/web/web_match.c +++ b/web/web_match.c @@ -83,26 +83,7 @@ void match_opts_free() match_opts = NULL; } -struct leg *state_active_leg() -{ - return state->m->legs[state->m->active_player - 1]; -} - bool match_player_is_comp(int pn) { return state->m->players[pn - 1].type == PT_COMP; } - -bool match_first_user_has_thrown() -{ - for (int i = 0, np = state->m->n_players; i < np; ++i) { - int pn = match_opts->throws_first + i; - if (pn > np) - pn -= np; - - if (!match_player_is_comp(pn)) - return !!state->m->legs[pn - 1]->n_visits; - } - - return false; -} -- cgit v1.2.3-70-g09d2