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