aboutsummaryrefslogtreecommitdiff
path: root/dat.h
diff options
context:
space:
mode:
Diffstat (limited to 'dat.h')
-rw-r--r--dat.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/dat.h b/dat.h
index 2a2c6b5..6d2a6ba 100644
--- a/dat.h
+++ b/dat.h
@@ -5,6 +5,9 @@ enum {
Tmiss,
NTILES,
+ OH, /* horizontal */
+ OV, /* vertical */
+
Waiting0 = 0,
Outlaying,
Waiting1,
@@ -22,8 +25,8 @@ enum {
};
typedef struct Input Input;
-typedef struct Board Board;
typedef struct Ship Ship;
+typedef struct Board Board;
typedef struct Player Player;
typedef struct Playerq Playerq;
typedef struct Chanpipe Chanpipe;
@@ -34,24 +37,28 @@ struct Input
Keyboardctl *kc;
};
-struct Board
+struct Ship
{
- RFrame;
- char map[17][17];
+ Point2 p; /* board cell */
Rectangle bbox;
+ int orient;
+ int ncells;
+ int *hit; /* |hit| = ncells and hit = {x: 0 ≤ x ≤ 1} */
+ int sunk;
};
-struct Ship
+struct Board
{
RFrame;
- int ncells;
- int sunk;
+ char map[17][17];
+ Rectangle bbox;
};
struct Player
{
int fd;
int sfd;
+ Channel *mc; /* for matching */
Player *o; /* opponent */
};