]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/server/voxel_depth_search.h
27127070d8cc9a85f0204d8cee8510918344f382
[dragonblocks_alpha.git] / src / server / voxel_depth_search.h
1 #ifndef _VOXEL_DEPTH_SEARCH_
2 #define _VOXEL_DEPTH_SEARCH_
3
4 #include <dragonstd/tree.h>
5 #include <stdbool.h>
6 #include "types.h"
7
8 typedef enum {
9         DEPTH_SEARCH_TARGET, // goal has been reached
10         DEPTH_SEARCH_PATH,   // can used this as path
11         DEPTH_SEARCH_BLOCK   // cannot use this as paths
12 } DepthSearchNodeType;
13
14 typedef struct {
15         v3s32 pos;
16         DepthSearchNodeType type;
17         bool *success;
18 } DepthSearchNode;
19
20 bool voxel_depth_search(v3s32 pos, DepthSearchNodeType (*get_type)(v3s32 pos), bool *success, Tree *visit);
21
22 #endif // _VOXEL_DEPTH_SEARCH_