diff options
author | rodri <rgl@antares-labs.eu> | 2023-09-26 18:39:02 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2023-09-26 18:39:02 +0000 |
commit | 05825e751d69cde554c21ddfd00e646049425e31 (patch) | |
tree | 0ba2620bd9df21613b422e3eb475bd21cac8b4a1 /dat.h | |
parent | 2293ed78636e5f66b5e2884bebd193803cb6939f (diff) | |
download | battleship-05825e751d69cde554c21ddfd00e646049425e31.tar.gz battleship-05825e751d69cde554c21ddfd00e646049425e31.tar.bz2 battleship-05825e751d69cde554c21ddfd00e646049425e31.zip |
initial work towards spectator mode.
Diffstat (limited to 'dat.h')
-rw-r--r-- | dat.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -5,6 +5,9 @@ enum { Tmiss, NTILES, + TBITS = 2, /* ceil(log(NTILES)/log(2)) */ + TMASK = (1<<TBITS) - 1, + Scarrier = 0, Sbattleship, Scruiser, @@ -31,6 +34,7 @@ enum { SCRH = Boardmargin+MAPH*TH+TH+MAPH*TH+Boardmargin, KB = 1024, + BY2MAP = TBITS*MAPW*MAPH/8+1, }; typedef struct Ship Ship; @@ -41,6 +45,7 @@ typedef struct Player Player; typedef struct Match Match; typedef struct Msg Msg; typedef struct Stands Stands; +typedef struct MatchInfo MatchInfo; struct Ship { @@ -106,6 +111,13 @@ struct Stands ulong cap; }; +struct MatchInfo +{ + int id; + char *pl[2]; + Board *bl[2]; +}; + typedef struct Mentry Mentry; typedef struct Mlist Mlist; typedef struct Menulist Menulist; |