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