From 8285721acfc247d57e0831503543dd29290ac4c5 Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 12 Aug 2023 05:35:54 +0000 Subject: latest try of player mgmt procedure. (not working) --- dat.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'dat.h') diff --git a/dat.h b/dat.h index b0350e1..2a2c6b5 100644 --- a/dat.h +++ b/dat.h @@ -5,6 +5,11 @@ enum { Tmiss, NTILES, + Waiting0 = 0, + Outlaying, + Waiting1, + Playing, + Boardmargin = 50, TW = 16, TH = TW, @@ -12,10 +17,16 @@ enum { MAPH = MAPW, SCRW = Boardmargin+MAPW*TW+Boardmargin, SCRH = Boardmargin+MAPH*TH+TH+MAPH*TH+Boardmargin, + + KB = 1024, }; typedef struct Input Input; typedef struct Board Board; +typedef struct Ship Ship; +typedef struct Player Player; +typedef struct Playerq Playerq; +typedef struct Chanpipe Chanpipe; struct Input { @@ -29,3 +40,31 @@ struct Board char map[17][17]; Rectangle bbox; }; + +struct Ship +{ + RFrame; + int ncells; + int sunk; +}; + +struct Player +{ + int fd; + int sfd; + Player *o; /* opponent */ +}; + +struct Playerq +{ + QLock; + Player **players; + ulong cap; + ulong nplayers; +}; + +struct Chanpipe +{ + Channel *c; + int fd; +}; -- cgit v1.2.3