diff options
Diffstat (limited to 'dat.h')
-rw-r--r-- | dat.h | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -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; +}; |