mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
move Chunks from Level to Player
This commit is contained in:
parent
b7664b4188
commit
1c18c02092
40 changed files with 450 additions and 220 deletions
|
|
@ -14,19 +14,20 @@ class Level;
|
|||
class Chunk;
|
||||
class Chunks;
|
||||
class Lighting;
|
||||
class GlobalChunks;
|
||||
class ContentIndices;
|
||||
|
||||
enum class BlockInteraction { step, destruction, placing };
|
||||
|
||||
/// @brief Player argument is nullable
|
||||
using on_block_interaction = std::function<
|
||||
void(Player*, const glm::ivec3&, const Block&, BlockInteraction type)>;
|
||||
void(Player*, const glm::ivec3&, const Block&, BlockInteraction)>;
|
||||
|
||||
/// BlocksController manages block updates and data (inventories, metadata)
|
||||
class BlocksController {
|
||||
const Level& level;
|
||||
Chunks& chunks;
|
||||
Lighting& lighting;
|
||||
GlobalChunks& chunks;
|
||||
Lighting* lighting;
|
||||
util::Clock randTickClock;
|
||||
util::Clock blocksTickClock;
|
||||
util::Clock worldTickClock;
|
||||
|
|
@ -34,7 +35,7 @@ class BlocksController {
|
|||
FastRandom random {};
|
||||
std::vector<on_block_interaction> blockInteractionCallbacks;
|
||||
public:
|
||||
BlocksController(const Level& level, Lighting& lighting, uint padding);
|
||||
BlocksController(const Level& level, Lighting* lighting, uint padding);
|
||||
|
||||
void updateSides(int x, int y, int z);
|
||||
void updateSides(int x, int y, int z, int w, int h, int d);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue