about summary refs log tree commit diff homepage
path: root/torus.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-04-09 01:25:43 -0400
committerJune McEnroe <june@causal.agency>2018-04-09 01:25:43 -0400
commitd5d7c11a43941f51b7fcbc7614fc81fb6cc8d883 (patch)
treefb57f6052a242445f975536ff5c1ec60020074a5 /torus.h
parentReplace #define with enum or const where possible (diff)
downloadtorus-d5d7c11a43941f51b7fcbc7614fc81fb6cc8d883.tar.gz
torus-d5d7c11a43941f51b7fcbc7614fc81fb6cc8d883.zip
Use anonymous union
Diffstat (limited to '')
-rw-r--r--torus.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/torus.h b/torus.h
index 7597878..92cf934 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;
+    };
 };