3#include <unordered_set>
9#include <condition_variable>
21 class InventoryManager;
31 class BehaviourRenderer;
57 RenderingManager(std::shared_ptr<World> world_, std::shared_ptr<InventoryManager> inventory_manager_,
58 std::shared_ptr<EntityManager> entity_manager_,
59 const unsigned int& window_width,
const unsigned int& window_height,
60 const unsigned int section_height_ = 16,
const bool headless =
false);
73 void SetPosOrientation(
const double x_,
const double y_,
const double z_,
const float yaw_,
const float pitch_);
98#if PROTOCOL_VERSION < 757
99 virtual void Handle(ProtocolCraft::ClientboundLevelChunkPacket& msg)
override;
106#if PROTOCOL_VERSION < 759
107 virtual void Handle(ProtocolCraft::ClientboundAddMobPacket& msg)
override;
109#if PROTOCOL_VERSION < 721
110 virtual void Handle(ProtocolCraft::ClientboundAddGlobalEntityPacket& msg)
override;
112#if PROTOCOL_VERSION < 764
113 virtual void Handle(ProtocolCraft::ClientboundAddPlayerPacket& msg)
override;
116#if PROTOCOL_VERSION < 755
117 virtual void Handle(ProtocolCraft::ClientboundMoveEntityPacket& msg)
override;
123#if PROTOCOL_VERSION == 755
124 virtual void Handle(ProtocolCraft::ClientboundRemoveEntityPacket& msg)
override;
137 bool Init(
const bool headless);
140 void Run(
const bool headless);
void BehaviourTickChild(const size_t i) const
void ResetBehaviourState() const
std::thread thread_updating_renderable
std::unordered_set< int > entities_to_update
void WaitForRenderingUpdate()
void BehaviourStartTick() const
bool Init(const bool headless)
std::unique_ptr< BehaviourRenderer > behaviour_renderer
void InternalProcessInput(GLFWwindow *window)
void SetKeyboardCallback(std::function< void(std::array< bool, static_cast< int >(KEY_CODE::NUMBER_OF_KEYS)>, double)> callback)
std::string screenshot_path
void ResetBlackboard() const
std::function< void(double, double)> MouseCallback
void Screenshot(const std::string &path)
std::condition_variable condition_update
std::shared_ptr< LocalPlayer > local_player
void AddChunkToUpdate(const int x, const int z)
std::shared_ptr< World > world
void SetCurrentBehaviourTree(const BaseNode *root) const
void Run(const bool headless)
static void ResizeCallback(GLFWwindow *window, int width, int height)
std::unique_ptr< WorldRenderer > world_renderer
std::unordered_set< Position > chunks_to_udpate
std::shared_ptr< EntityManager > entity_manager
void RemoveBlackboardValue(const std::string &key) const
static void InternalMouseCallback(GLFWwindow *window, double xpos, double ypos)
void UpdateBlackboardValue(const std::string &key, const std::any &value) const
void SetMouseCallback(std::function< void(double, double)> callback)
int current_window_height
void BehaviourEndTick(const bool b) const
std::unique_ptr< Shader > my_shader
virtual void Handle(ProtocolCraft::ClientboundBlockUpdatePacket &msg) override
std::mutex mutex_updating
std::function< void(std::array< bool, static_cast< int >(KEY_CODE::NUMBER_OF_KEYS)>, double)> KeyboardCallback
std::thread rendering_thread
std::shared_ptr< InventoryManager > inventory_manager
bool IsBehaviourGUIPaused() const
std::array< bool, static_cast< int >(KEY_CODE::NUMBER_OF_KEYS)> is_key_pressed
void AddEntityToUpdate(const int id)
void SetPosOrientation(const double x_, const double y_, const double z_, const float yaw_, const float pitch_)