]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/node.h
8ef9108810c0fd79bcfe32b49e96ecebe3544041
[dragonblocks_alpha.git] / src / node.h
1 #ifndef _NODE_H_
2 #define _NODE_H_
3
4 #include <stdbool.h>
5 #include "types.h"
6
7 typedef v3f NodeStateBiome;
8
9 typedef union
10 {
11         NodeStateBiome biome;
12 } NodeState;
13
14 typedef enum
15 {
16         NODE_INVALID,           // Used for unknown nodes received from server (caused by outdated clients)
17         NODE_AIR,
18         NODE_GRASS,
19         NODE_DIRT,
20         NODE_STONE,
21         NODE_SNOW,
22         NODE_UNLOADED,          // Used for nodes in unloaded blocks
23 } Node;
24
25 struct MapNode;
26
27 typedef struct
28 {
29         bool visible;
30         bool solid;
31         void (*create)(struct MapNode *node);
32         void (*serialize)(struct MapNode *node);
33         void (*deserialize)(struct MapNode *node);
34 } NodeDefintion;
35
36 extern NodeDefintion node_definitions[];
37
38 #endif