summary refs log tree commit diff
path: root/src/World/Generation/ChunkNeighbors.hpp
blob: 83fca4ca337c671511d2f4cbea529be5f68a7214 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include "../Chunk.hpp"
#include "../ChunkRegistry.hpp"

namespace MC::World::Generation {
struct ChunkNeighbors {
    Chunk *north, *east, *south, *west;
    Chunk *north_east, *south_east, *south_west, *north_west;

    Bool all_exist() const { return north && east && south && west && north_east && south_east && south_west && north_west; }
};

ChunkNeighbors find_chunk_neighbors(ChunkIndex chunk, ChunkRegistry& chunks);

struct GetBlockWrappingResult {
    bool does_exist;
    Chunk::BlockData block;
};
GetBlockWrappingResult get_block_wrapping(const Chunk& chunk, const ChunkNeighbors& neighbors, Vector<3, I32> pos);

}