From a6e0c9ce9b6c468d0e622ffb5c05eba664ea4f47 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Tue, 17 Oct 2017 23:33:13 +0500 Subject: Refactored #include directives --- src/AssetManager.cpp | 8 +++++++- src/AssetManager.hpp | 9 +++++---- src/Event.cpp | 3 +++ src/Event.hpp | 6 +++--- src/GameState.cpp | 8 ++++++-- src/GameState.hpp | 15 +++++++++------ src/GlobalState.cpp | 1 + src/GlobalState.hpp | 3 --- src/Network.cpp | 3 +++ src/Network.hpp | 3 +-- src/NetworkClient.cpp | 24 ++++++++++++++---------- src/NetworkClient.hpp | 12 +++++++----- src/Render.cpp | 11 +++++++---- src/Render.hpp | 11 +++++++++-- src/Renderer.cpp | 2 -- src/Renderer.hpp | 1 - src/RendererEntity.cpp | 7 +++++++ src/RendererEntity.hpp | 9 +++------ src/RendererSection.cpp | 10 ++++++++-- src/RendererSection.hpp | 27 ++++++++++++--------------- src/RendererSky.cpp | 3 +++ src/RendererSky.hpp | 7 ++----- src/RendererWorld.cpp | 33 +++++++++++++++++++++++---------- src/RendererWorld.hpp | 17 ++++++++++++----- src/Section.hpp | 5 ----- src/Shader.cpp | 5 +++++ src/Shader.hpp | 8 -------- src/Socket.cpp | 1 - src/Stream.cpp | 5 +++++ src/Stream.hpp | 12 +++--------- src/Texture.cpp | 1 + src/Texture.hpp | 3 ++- src/Thread.cpp | 1 - src/Thread.hpp | 7 ------- src/Utility.cpp | 5 ++++- src/Utility.hpp | 2 +- src/Vector.hpp | 1 - src/Window.hpp | 1 - src/World.cpp | 6 ++++++ src/World.hpp | 13 ++++++++----- src/main.cpp | 2 ++ 41 files changed, 182 insertions(+), 129 deletions(-) delete mode 100644 src/Thread.cpp delete mode 100644 src/Thread.hpp diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 303f18a..0507bc1 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -1,7 +1,13 @@ -#include #include "AssetManager.hpp" + +#include #include +#include +#include + +#include "Texture.hpp" + namespace fs = std::experimental::filesystem::v1; //const fs::path pathToAssets = "./assets/"; diff --git a/src/AssetManager.hpp b/src/AssetManager.hpp index 7cb7f8f..1169b7d 100644 --- a/src/AssetManager.hpp +++ b/src/AssetManager.hpp @@ -1,15 +1,16 @@ #pragma once +#include +#include #include -#include #include #include -#include -#include "Block.hpp" -#include "Texture.hpp" #include "Vector.hpp" +#include "Block.hpp" + +class Texture; struct TextureCoordinates { TextureCoordinates(float x = -1, float y = -1, float w = -1, float h = -1) : x(x), y(y), w(w), h(h) {} diff --git a/src/Event.cpp b/src/Event.cpp index 1a0816f..1f3a9e8 100644 --- a/src/Event.cpp +++ b/src/Event.cpp @@ -1,6 +1,9 @@ #include "Event.hpp" + #include +#include "Utility.hpp" + std::queue EventAgregator::eventsToHandle; std::mutex EventAgregator::queueMutex; bool EventAgregator::isStarted = false; diff --git a/src/Event.hpp b/src/Event.hpp index 021af0d..4962ee9 100644 --- a/src/Event.hpp +++ b/src/Event.hpp @@ -4,15 +4,15 @@ #include #include #include -#include -#include #include #include #include #include "Vector.hpp" -#include "Packet.hpp" +#include "Chat.hpp" + +class Packet; enum class EventType { Echo, diff --git a/src/GameState.cpp b/src/GameState.cpp index 945824f..cea92d6 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -1,7 +1,11 @@ #include "GameState.hpp" + +#include +#include + #include "Event.hpp" -#include -#include "GlobalState.hpp" +#include "Packet.hpp" +#include "NetworkClient.hpp" void GameState::Update(float deltaTime) { if (g_IsGameStarted) { diff --git a/src/GameState.hpp b/src/GameState.hpp index 0551f1c..bee89bf 100644 --- a/src/GameState.hpp +++ b/src/GameState.hpp @@ -1,15 +1,18 @@ #pragma once -#include -#include -#include +#include +#include +#include + +#include #include "World.hpp" -#include "NetworkClient.hpp" -#include "Vector.hpp" -#include "Event.hpp" #include "Window.hpp" +class Packet; +class NetworkClient; +class Entity; + class GameState { std::mutex packetsMutex; std::queue> packets; diff --git a/src/GlobalState.cpp b/src/GlobalState.cpp index 23c7e51..c7a36ad 100644 --- a/src/GlobalState.cpp +++ b/src/GlobalState.cpp @@ -4,6 +4,7 @@ #include "GameState.hpp" #include "Render.hpp" #include "DebugInfo.hpp" +#include "Event.hpp" //Global game variables diff --git a/src/GlobalState.hpp b/src/GlobalState.hpp index c0f1769..b3b4635 100644 --- a/src/GlobalState.hpp +++ b/src/GlobalState.hpp @@ -1,8 +1,5 @@ #pragma once -#include -#include - class NetworkClient; class GameState; class Render; diff --git a/src/Network.cpp b/src/Network.cpp index 2c14327..c8be740 100644 --- a/src/Network.cpp +++ b/src/Network.cpp @@ -1,6 +1,9 @@ #include "Network.hpp" #include +#include + +#include "Socket.hpp" Network::Network(std::string address, unsigned short port) { try { diff --git a/src/Network.hpp b/src/Network.hpp index f28f808..5d7fc38 100644 --- a/src/Network.hpp +++ b/src/Network.hpp @@ -1,10 +1,9 @@ #pragma once #include -#include "Socket.hpp" #include "Packet.hpp" -enum ConnectionState { +enum ConnectionState : unsigned char { Handshaking, Login, Play, diff --git a/src/NetworkClient.cpp b/src/NetworkClient.cpp index 36c6912..38cb947 100644 --- a/src/NetworkClient.cpp +++ b/src/NetworkClient.cpp @@ -1,7 +1,11 @@ #include "NetworkClient.hpp" -NetworkClient::NetworkClient(std::string address, unsigned short port, std::string username) - : network(address, port) { +#include + +#include "Network.hpp" + +NetworkClient::NetworkClient(std::string address, unsigned short port, std::string username) { + network = std::make_unique(address, port); state = Handshaking; PacketHandshake handshake; @@ -9,18 +13,18 @@ NetworkClient::NetworkClient(std::string address, unsigned short port, std::stri handshake.serverAddress = address; handshake.serverPort = port; handshake.nextState = 2; - network.SendPacket(handshake); + network->SendPacket(handshake); state = Login; PacketLoginStart loginStart; loginStart.Username = username; - network.SendPacket(loginStart); + network->SendPacket(loginStart); - auto packet = network.ReceivePacket(Login); + auto packet = network->ReceivePacket(Login); while (!packet) - packet = network.ReceivePacket(Login); + packet = network->ReceivePacket(Login); if (packet->GetPacketId() == PacketNameLoginCB::SetCompression) { auto compPacket = std::static_pointer_cast(packet); @@ -28,7 +32,7 @@ NetworkClient::NetworkClient(std::string address, unsigned short port, std::stri compressionThreshold = compPacket->Threshold; packet.reset(); while (!packet) - packet = network.ReceivePacket(Login, compressionThreshold >= 0); + packet = network->ReceivePacket(Login, compressionThreshold >= 0); } auto response = std::static_pointer_cast(packet); @@ -60,11 +64,11 @@ void NetworkClient::SendPacket(std::shared_ptr packet) { void NetworkClient::UpdatePacket() { while (!toSend.empty()) { if (toSend.front() != nullptr) - network.SendPacket(*toSend.front(), compressionThreshold); + network->SendPacket(*toSend.front(), compressionThreshold); toSend.pop(); } - auto packet = network.ReceivePacket(state, compressionThreshold >= 0); + auto packet = network->ReceivePacket(state, compressionThreshold >= 0); if (packet.get() != nullptr) { if (packet->GetPacketId() != PacketNamePlayCB::KeepAliveCB) { toReceive.push(packet); @@ -73,7 +77,7 @@ void NetworkClient::UpdatePacket() { timeOfLastKeepAlivePacket = std::chrono::steady_clock::now(); auto packetKeepAlive = std::static_pointer_cast(packet); auto packetKeepAliveSB = std::make_shared(packetKeepAlive->KeepAliveId); - network.SendPacket(*packetKeepAliveSB, compressionThreshold); + network->SendPacket(*packetKeepAliveSB, compressionThreshold); } } using namespace std::chrono_literals; diff --git a/src/NetworkClient.hpp b/src/NetworkClient.hpp index a26c262..2bcbd9f 100644 --- a/src/NetworkClient.hpp +++ b/src/NetworkClient.hpp @@ -1,14 +1,16 @@ #pragma once -#include +#include #include -#include +#include +#include -#include "Network.hpp" -#include "Event.hpp" +class Network; +struct Packet; +enum ConnectionState : unsigned char; class NetworkClient { - Network network; + std::unique_ptr network; std::queue > toSend; std::queue > toReceive; ConnectionState state; diff --git a/src/Render.cpp b/src/Render.cpp index befc982..1e7f45c 100644 --- a/src/Render.cpp +++ b/src/Render.cpp @@ -1,14 +1,17 @@ #include "Render.hpp" -#include "Utility.hpp" +#include +#include + +#include "imgui_impl_sdl_gl3.h" #include "Shader.hpp" #include "AssetManager.hpp" #include "Event.hpp" #include "DebugInfo.hpp" #include "GlobalState.hpp" - -#include -#include "imgui_impl_sdl_gl3.h" +#include "World.hpp" +#include "GameState.hpp" +#include "RendererWorld.hpp" Render::Render(unsigned int windowWidth, unsigned int windowHeight, std::string windowTitle) : timer(std::chrono::milliseconds(16)) { InitSfml(windowWidth, windowHeight, windowTitle); diff --git a/src/Render.hpp b/src/Render.hpp index 8c4b4e8..3998f26 100644 --- a/src/Render.hpp +++ b/src/Render.hpp @@ -1,9 +1,16 @@ #pragma once +#include +#include +#include +#include + #include -#include "Shader.hpp" -#include "RendererWorld.hpp" +#include "Utility.hpp" +#include "Renderer.hpp" + +class RendererWorld; class Render { SDL_Window *window; diff --git a/src/Renderer.cpp b/src/Renderer.cpp index 76cef4e..0db23db 100644 --- a/src/Renderer.cpp +++ b/src/Renderer.cpp @@ -3,8 +3,6 @@ void RenderState::SetActiveVao(GLuint Vao) { glBindVertexArray(Vao); ActiveVao = Vao; - /*if (Vao != ActiveVao) { - }*/ } void RenderState::SetActiveShader(GLuint Shader) { diff --git a/src/Renderer.hpp b/src/Renderer.hpp index 306a310..ed3d1fa 100644 --- a/src/Renderer.hpp +++ b/src/Renderer.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include "Utility.hpp" class RenderState { GLuint ActiveVao = -1; diff --git a/src/RendererEntity.cpp b/src/RendererEntity.cpp index 0bc2606..951b1ad 100644 --- a/src/RendererEntity.cpp +++ b/src/RendererEntity.cpp @@ -1,5 +1,12 @@ #include "RendererEntity.hpp" +#include +#include + +#include "Entity.hpp" +#include "World.hpp" +#include "Renderer.hpp" + const GLfloat vertices[] = { //Z+ edge -0.5f, 0.5f, 0.5f, diff --git a/src/RendererEntity.hpp b/src/RendererEntity.hpp index 578e24b..76548c6 100644 --- a/src/RendererEntity.hpp +++ b/src/RendererEntity.hpp @@ -1,12 +1,9 @@ #pragma once -#include -#include -#include +#include -#include "Renderer.hpp" -#include "Entity.hpp" -#include "World.hpp" +class World; +class RenderState; class RendererEntity { unsigned int entityId; diff --git a/src/RendererSection.cpp b/src/RendererSection.cpp index 55761f7..6fed06f 100644 --- a/src/RendererSection.cpp +++ b/src/RendererSection.cpp @@ -1,6 +1,12 @@ #include "RendererSection.hpp" -#include +#include +#include + +#include "AssetManager.hpp" +#include "World.hpp" +#include "Section.hpp" +#include "Renderer.hpp" const GLfloat vertices[] = { 0, 0, 0, @@ -444,7 +450,7 @@ const BlockModel* RendererSectionData::GetInternalBlockModel(const BlockId& id) if (it.first == id) return it.second; } - idModels.push_back(std::make_pair(id, am.GetBlockModelByBlockId(id))); + idModels.push_back(std::make_pair(id, AssetManager::Instance().GetBlockModelByBlockId(id))); return idModels.back().second; } diff --git a/src/RendererSection.hpp b/src/RendererSection.hpp index 6745987..26068e4 100644 --- a/src/RendererSection.hpp +++ b/src/RendererSection.hpp @@ -1,17 +1,18 @@ #pragma once +#include +#include + +#include #include -#include -#include -#include -#include -#include - -#include "AssetManager.hpp" -#include "Section.hpp" -#include "World.hpp" + #include "Vector.hpp" -#include "Renderer.hpp" +#include "Block.hpp" + +class BlockModel; +class AssetManager; +class World; +class RenderState; struct RendererSectionData { std::vector models; @@ -28,8 +29,6 @@ private: std::array GetBlockVisibilityData(World *world); - AssetManager& am = AssetManager::Instance(); - std::vector> idModels; const BlockModel* GetInternalBlockModel(const BlockId& id); @@ -42,9 +41,7 @@ private: inline const BlockId& GetBlockId(int x, int y, int z) { return blockIdData[y * 256 +z * 16 + x]; - } - - + } }; diff --git a/src/RendererSky.cpp b/src/RendererSky.cpp index e0e367b..d0e9518 100644 --- a/src/RendererSky.cpp +++ b/src/RendererSky.cpp @@ -1,5 +1,8 @@ #include "RendererSky.hpp" +#include "Renderer.hpp" +#include "Utility.hpp" + const GLfloat vertices[] = { //Z+ edge -0.5f, -0.5f, 0.5f, diff --git a/src/RendererSky.hpp b/src/RendererSky.hpp index 4dd0892..8c6a409 100644 --- a/src/RendererSky.hpp +++ b/src/RendererSky.hpp @@ -1,11 +1,8 @@ #pragma once -#include +#include -#include "Utility.hpp" -#include "Shader.hpp" -#include "Renderer.hpp" -#include "AssetManager.hpp" +class RenderState; class RendererSky { GLuint VboVert, VboUv, Vao; diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp index ea27b47..0d5a7c7 100644 --- a/src/RendererWorld.cpp +++ b/src/RendererWorld.cpp @@ -1,6 +1,16 @@ #include "RendererWorld.hpp" + +#include +#include + #include "DebugInfo.hpp" #include "Frustum.hpp" +#include "Event.hpp" +#include "AssetManager.hpp" +#include "Renderer.hpp" +#include "Shader.hpp" +#include "GameState.hpp" +#include "Section.hpp" void RendererWorld::WorkerFunction(size_t workerId) { EventListener tasksListener; @@ -87,14 +97,17 @@ void RendererWorld::UpdateAllSections(VectorF playerPos) } } -RendererWorld::RendererWorld(GameState* ptr):gs(ptr) { +RendererWorld::RendererWorld(GameState* ptr) { + gs = ptr; frustum = std::make_unique(); MaxRenderingDistance = 2; numOfWorkers = 2; + listener = std::make_unique(); + PrepareRender(); - listener.RegisterHandler(EventType::DeleteSectionRender, [this](EventData eventData) { + listener->RegisterHandler(EventType::DeleteSectionRender, [this](EventData eventData) { auto vec = std::get(eventData).pos; sectionsMutex.lock(); auto it = sections.find(vec); @@ -106,7 +119,7 @@ RendererWorld::RendererWorld(GameState* ptr):gs(ptr) { sectionsMutex.unlock(); }); - listener.RegisterHandler(EventType::NewRenderDataAvailable,[this](EventData eventData) { + listener->RegisterHandler(EventType::NewRenderDataAvailable,[this](EventData eventData) { renderDataMutex.lock(); int i = 0; while (!renderData.empty() && i++ < 20) { @@ -137,7 +150,7 @@ RendererWorld::RendererWorld(GameState* ptr):gs(ptr) { renderDataMutex.unlock(); }); - listener.RegisterHandler(EventType::EntityChanged, [this](EventData eventData) { + listener->RegisterHandler(EventType::EntityChanged, [this](EventData eventData) { auto data = std::get(eventData); for (unsigned int entityId : gs->world.GetEntitiesList()) { if (entityId == data.EntityId) { @@ -146,7 +159,7 @@ RendererWorld::RendererWorld(GameState* ptr):gs(ptr) { } }); - listener.RegisterHandler(EventType::ChunkChanged, [this](EventData eventData) { + listener->RegisterHandler(EventType::ChunkChanged, [this](EventData eventData) { auto vec = std::get(eventData).chunkPosition; Vector playerChunk(std::floor(gs->player->pos.x / 16), 0, std::floor(gs->player->pos.z / 16)); @@ -170,16 +183,16 @@ RendererWorld::RendererWorld(GameState* ptr):gs(ptr) { currentWorker = 0; }); - listener.RegisterHandler(EventType::UpdateSectionsRender, [this](EventData eventData) { + listener->RegisterHandler(EventType::UpdateSectionsRender, [this](EventData eventData) { UpdateAllSections(gs->player->pos); }); - listener.RegisterHandler(EventType::PlayerPosChanged, [this](EventData eventData) { + listener->RegisterHandler(EventType::PlayerPosChanged, [this](EventData eventData) { auto pos = std::get(eventData).newPos; UpdateAllSections(pos); }); - listener.RegisterHandler(EventType::ChunkDeleted, [this](EventData eventData) { + listener->RegisterHandler(EventType::ChunkDeleted, [this](EventData eventData) { auto pos = std::get(eventData).pos; sectionsMutex.lock(); auto it = sections.find(pos); @@ -364,8 +377,8 @@ void RendererWorld::PrepareRender() { void RendererWorld::Update(double timeToUpdate) { static auto timeSincePreviousUpdate = std::chrono::steady_clock::now(); int i = 0; - while (listener.IsEventsQueueIsNotEmpty() && i++ < 50) - listener.HandleEvent(); + while (listener->IsEventsQueueIsNotEmpty() && i++ < 50) + listener->HandleEvent(); if (std::chrono::steady_clock::now() - timeSincePreviousUpdate > std::chrono::seconds(5)) { EventAgregator::PushEvent(EventType::UpdateSectionsRender, UpdateSectionsRenderData{}); timeSincePreviousUpdate = std::chrono::steady_clock::now(); diff --git a/src/RendererWorld.hpp b/src/RendererWorld.hpp index e7bd512..11a659b 100644 --- a/src/RendererWorld.hpp +++ b/src/RendererWorld.hpp @@ -1,19 +1,26 @@ #pragma once +#include +#include +#include +#include +#include + #include "RendererSection.hpp" #include "RendererEntity.hpp" #include "RendererSky.hpp" -#include "GameState.hpp" -#include "Shader.hpp" - -#include class Frustum; +class GameState; +class Texture; +class Shader; +class EventListener; +class RenderState; class RendererWorld { //General GameState *gs; - EventListener listener; + std::unique_ptr listener; size_t numOfWorkers; size_t currentWorker = 0; std::vector workers; diff --git a/src/Section.hpp b/src/Section.hpp index 41bef7b..e647600 100644 --- a/src/Section.hpp +++ b/src/Section.hpp @@ -2,14 +2,9 @@ #include #include -#include -#include - -#include #include "Block.hpp" #include "Vector.hpp" -#include "Utility.hpp" class Section { std::vector block; diff --git a/src/Shader.cpp b/src/Shader.cpp index 164da69..d637c3b 100644 --- a/src/Shader.cpp +++ b/src/Shader.cpp @@ -1,5 +1,10 @@ #include "Shader.hpp" +#include +#include + +#include + Shader::Shader(const GLchar *vertexPath, const GLchar *fragmentPath, const GLchar *geometryPath) { vertex = vertexPath; fragment = fragmentPath; diff --git a/src/Shader.hpp b/src/Shader.hpp index 17a434e..d6d59eb 100644 --- a/src/Shader.hpp +++ b/src/Shader.hpp @@ -1,10 +1,5 @@ #pragma once -#include -#include -#include - -#include #include class Shader @@ -13,11 +8,8 @@ private: const GLchar *vertex; const GLchar *fragment; public: - // Идентификатор программы GLuint Program; - // Конструктор считывает и собирает шейдер Shader(const GLchar* vertexPath, const GLchar* fragmentPath, const GLchar* geometryPath = nullptr); - // Использование программы void Use(); void Reload(); diff --git a/src/Socket.cpp b/src/Socket.cpp index aea0c73..0effb3e 100644 --- a/src/Socket.cpp +++ b/src/Socket.cpp @@ -1,4 +1,3 @@ -#include #include "Socket.hpp" #include diff --git a/src/Stream.cpp b/src/Stream.cpp index 6237451..8f5d519 100644 --- a/src/Stream.cpp +++ b/src/Stream.cpp @@ -1,5 +1,10 @@ #include "Stream.hpp" +#include + +#include "Socket.hpp" +#include "Utility.hpp" + const int MAX_VARINT_LENGTH = 5; bool StreamInput::ReadBool() { diff --git a/src/Stream.hpp b/src/Stream.hpp index 3fb92df..b733d3b 100644 --- a/src/Stream.hpp +++ b/src/Stream.hpp @@ -1,19 +1,13 @@ #pragma once -#include -#include -#include #include -#include -#include -#include - -#include "Socket.hpp" -#include "Vector.hpp" #include "Utility.hpp" +#include "Vector.hpp" #include "Chat.hpp" +class Socket; + struct SlotData { short BlockId = -1; signed char ItemCount = 1; diff --git a/src/Texture.cpp b/src/Texture.cpp index d39585f..5693682 100644 --- a/src/Texture.cpp +++ b/src/Texture.cpp @@ -2,6 +2,7 @@ #include #include +#include bool IsImgInitialized = false; diff --git a/src/Texture.hpp b/src/Texture.hpp index 6b024d4..cda3e36 100644 --- a/src/Texture.hpp +++ b/src/Texture.hpp @@ -1,6 +1,7 @@ #pragma once -#include +#include + #include class Texture { diff --git a/src/Thread.cpp b/src/Thread.cpp deleted file mode 100644 index 3ebc2c2..0000000 --- a/src/Thread.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "Thread.hpp" diff --git a/src/Thread.hpp b/src/Thread.hpp deleted file mode 100644 index ddc0dc5..0000000 --- a/src/Thread.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -struct Thread { - Thread() = default; - virtual ~Thread() = default; - virtual void Execute() = 0; -}; \ No newline at end of file diff --git a/src/Utility.cpp b/src/Utility.cpp index 8be82d6..0fb10cf 100644 --- a/src/Utility.cpp +++ b/src/Utility.cpp @@ -1,6 +1,9 @@ -#include #include "Utility.hpp" +#include + +#include + GLenum glCheckError_(const char *file, int line) { GLenum errorCode; while ((errorCode = glGetError()) != GL_NO_ERROR) { diff --git a/src/Utility.hpp b/src/Utility.hpp index 893f38e..e8c508d 100644 --- a/src/Utility.hpp +++ b/src/Utility.hpp @@ -3,8 +3,8 @@ #include #include #include +#include -#include #include using Uuid = std::vector; diff --git a/src/Vector.hpp b/src/Vector.hpp index c89154f..0046b4a 100644 --- a/src/Vector.hpp +++ b/src/Vector.hpp @@ -2,7 +2,6 @@ #include #include -#include #include diff --git a/src/Window.hpp b/src/Window.hpp index a6bccd9..94fdca3 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -1,6 +1,5 @@ #pragma once -#include #include #include "Packet.hpp" diff --git a/src/World.cpp b/src/World.cpp index 7b150b7..c6f3fc8 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -1,6 +1,12 @@ #include "World.hpp" + +#include + +#include "Section.hpp" #include "Event.hpp" #include "DebugInfo.hpp" +#include "Packet.hpp" +#include "Collision.hpp" void World::ParseChunkData(std::shared_ptr packet) { StreamBuffer chunkData(packet->Data.data(), packet->Data.size()); diff --git a/src/World.hpp b/src/World.hpp index 31290c8..c245947 100644 --- a/src/World.hpp +++ b/src/World.hpp @@ -1,20 +1,23 @@ #pragma once #include -#include #include #include +#include #include - #include "Entity.hpp" #include "Block.hpp" -#include "Section.hpp" -#include "Packet.hpp" -#include "Collision.hpp" #include "Vector.hpp" +class Section; +class PacketChunkData; +class PacketBlockChange; +class PacketMultiBlockChange; +class PacketUnloadChunk; +class StreamInput; + class World { int dimension = 0; diff --git a/src/main.cpp b/src/main.cpp index 8c70bc8..2b213b3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,6 +4,8 @@ #include +#include + const char *getTimeSinceProgramStart(void) { static auto initialTime = std::chrono::steady_clock().now(); auto now = std::chrono::steady_clock().now(); -- cgit v1.2.3