From 22646d963e2b0c9b5ef629aa7704158026cfa6d1 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 1 May 2022 15:07:11 -0700 Subject: web: split code into more files This is currently very messy with all the files interdependent on one another and a lot of the logic still in the main file. It will take some time to refactor and clean up. --- web/web_match.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 web/web_match.h (limited to 'web/web_match.h') diff --git a/web/web_match.h b/web/web_match.h new file mode 100644 index 0000000..4b4c7bb --- /dev/null +++ b/web/web_match.h @@ -0,0 +1,29 @@ +#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]; + struct leg *active_leg; + int active_player; + int boat_undone; + int num_darts; +}; + +extern struct match_state *state; + +void free_state(); + +bool is_match_over(); + +#endif -- cgit v1.2.3-70-g09d2