aboutsummaryrefslogtreecommitdiff
path: root/dat.h
diff options
context:
space:
mode:
Diffstat (limited to 'dat.h')
-rw-r--r--dat.h39
1 files changed, 39 insertions, 0 deletions
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;
+};