summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/array.h2
-rw-r--r--include/content.h15
2 files changed, 14 insertions, 3 deletions
diff --git a/include/array.h b/include/array.h
index 5f81798..9affdde 100644
--- a/include/array.h
+++ b/include/array.h
@@ -6,6 +6,8 @@
#define ARRAY_H
#include <stddef.h>
+#include <string.h>
+#include <stdlib.h>
#define len(X) (sizeof X / sizeof *X)
#define array(T) struct { size_t len; T *data; }
diff --git a/include/content.h b/include/content.h
index 16118f6..ef27e22 100644
--- a/include/content.h
+++ b/include/content.h
@@ -14,9 +14,7 @@
#define PKT_NODES_MAX (50*50)
typedef enum : uint16_t {
- N_VALLEY_FLOWER = 0,
- N_MOUNTAIN_FLOWER,
- N_BIG_TREE,
+ N_BIG_TREE = 0,
N_NEEDLE_TREE,
N_ROCK,
N_WATER,
@@ -133,6 +131,7 @@ typedef uint64_t entity_id;
typedef enum : uint16_t {
ENTITY_PLAYER = 0,
+ ENTITY_FLOWER,
} entity_type;
#define ser_entity_type ser_u16
@@ -142,11 +141,21 @@ typedef enum : uint8_t {
ENTITY_ADD = 0, // type
ENTITY_REMOVE,
ENTITY_MOVE, // x y
+ ENTITY_CMD_COUNT,
} entity_cmd;
#define ser_entity_cmd ser_u8
#define deser_entity_cmd deser_u8
+typedef struct {
+ entity_id id;
+ entity_type type;
+ vec2 pos;
+ union {
+ flower_type flower;
+ };
+} entity;
+
enum : uint16_t {
CPKT_HI = 0, // len motd
CPKT_FAIL, // fail_reason