format: reformat project
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#ifndef LOGIC_BLOCKS_CONTROLLER_HPP_
|
||||
#define LOGIC_BLOCKS_CONTROLLER_HPP_
|
||||
|
||||
#include "../typedefs.hpp"
|
||||
#include "../maths/fastmaths.hpp"
|
||||
#include "../voxels/voxel.hpp"
|
||||
#include "../util/Clock.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "../maths/fastmaths.hpp"
|
||||
#include "../typedefs.hpp"
|
||||
#include "../util/Clock.hpp"
|
||||
#include "../voxels/voxel.hpp"
|
||||
|
||||
class Player;
|
||||
class Block;
|
||||
class Level;
|
||||
@@ -17,22 +17,17 @@ class Chunks;
|
||||
class Lighting;
|
||||
class ContentIndices;
|
||||
|
||||
enum class BlockInteraction {
|
||||
step,
|
||||
destruction,
|
||||
placing
|
||||
};
|
||||
enum class BlockInteraction { step, destruction, placing };
|
||||
|
||||
/// @brief Player argument is nullable
|
||||
using on_block_interaction = std::function<void(
|
||||
Player*, glm::ivec3, const Block*, BlockInteraction type
|
||||
)>;
|
||||
using on_block_interaction = std::function<
|
||||
void(Player*, glm::ivec3, const Block*, BlockInteraction type)>;
|
||||
|
||||
/// BlocksController manages block updates and data (inventories, metadata)
|
||||
class BlocksController {
|
||||
Level* level;
|
||||
Chunks* chunks;
|
||||
Lighting* lighting;
|
||||
Chunks* chunks;
|
||||
Lighting* lighting;
|
||||
util::Clock randTickClock;
|
||||
util::Clock blocksTickClock;
|
||||
util::Clock worldTickClock;
|
||||
@@ -46,10 +41,14 @@ public:
|
||||
void updateBlock(int x, int y, int z);
|
||||
|
||||
void breakBlock(Player* player, const Block* def, int x, int y, int z);
|
||||
void placeBlock(Player* player, const Block* def, blockstate state, int x, int y, int z);
|
||||
void placeBlock(
|
||||
Player* player, const Block* def, blockstate state, int x, int y, int z
|
||||
);
|
||||
|
||||
void update(float delta);
|
||||
void randomTick(const Chunk& chunk, int segments, const ContentIndices* indices);
|
||||
void randomTick(
|
||||
const Chunk& chunk, int segments, const ContentIndices* indices
|
||||
);
|
||||
void randomTick(int tickid, int parts);
|
||||
void onBlocksTick(int tickid, int parts);
|
||||
int64_t createBlockInventory(int x, int y, int z);
|
||||
@@ -57,14 +56,11 @@ public:
|
||||
void unbindInventory(int x, int y, int z);
|
||||
|
||||
void onBlockInteraction(
|
||||
Player* player,
|
||||
glm::ivec3 pos,
|
||||
const Block* def,
|
||||
BlockInteraction type
|
||||
Player* player, glm::ivec3 pos, const Block* def, BlockInteraction type
|
||||
);
|
||||
|
||||
/// @brief Add block interaction callback
|
||||
void listenBlockInteraction(const on_block_interaction& callback);
|
||||
};
|
||||
|
||||
#endif // LOGIC_BLOCKS_CONTROLLER_HPP_
|
||||
#endif // LOGIC_BLOCKS_CONTROLLER_HPP_
|
||||
|
||||
Reference in New Issue
Block a user