summaryrefslogtreecommitdiff
path: root/include/content.h
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2024-07-13 12:47:36 +0200
committerLizzy Fleckenstein <lizzy@vlhl.dev>2024-07-13 12:47:36 +0200
commit95283d70eee749d984b2ca07c0b61d39f9bb350d (patch)
treee4d666a4c58f4877bf619e826f6697cd4914bf9a /include/content.h
parentf7b1199a46f4034a49b624afa0d0b74535fa9623 (diff)
implement entities
Signed-off-by: Lizzy Fleckenstein <lizzy@vlhl.dev>
Diffstat (limited to 'include/content.h')
-rw-r--r--include/content.h15
1 files changed, 12 insertions, 3 deletions
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