diff options
author | June McEnroe <june@causal.agency> | 2018-04-09 01:25:43 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2018-04-09 01:25:43 -0400 |
commit | 6dadef0381d8b7a63f40b185b3592f27b55453cd (patch) | |
tree | ca6784a44b5154af2f707b5a213b0b5b796cd29d /torus.h | |
parent | Replace #define with enum or const where possible (diff) | |
download | torus-6dadef0381d8b7a63f40b185b3592f27b55453cd.tar.gz torus-6dadef0381d8b7a63f40b185b3592f27b55453cd.zip |
Use anonymous union
Diffstat (limited to '')
-rw-r--r-- | torus.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/torus.h b/torus.h index 72895f2..5e01aaa 100644 --- a/torus.h +++ b/torus.h @@ -99,20 +99,20 @@ struct ServerMessage { struct { uint8_t cellX; uint8_t cellY; - } m; + } move; struct { uint8_t cellX; uint8_t cellY; uint8_t color; char cell; - } p; + } put; struct { uint8_t oldCellX; uint8_t oldCellY; uint8_t newCellX; uint8_t newCellY; - } c; - } data; + } cursor; + }; }; static const uint8_t CURSOR_NONE = UINT8_MAX; @@ -127,13 +127,11 @@ struct ClientMessage { struct { int8_t dx; int8_t dy; - } m; + } move; struct { uint8_t color; char cell; - } p; - struct { - uint8_t spawn; - } s; - } data; + } put; + uint8_t spawn; + }; }; |