From a2fe2786682e626dae25db2d375280c83b615796 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Fri, 18 Aug 2017 20:13:01 +0500 Subject: 2017-08-18 --- src/World.hpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/World.hpp') diff --git a/src/World.hpp b/src/World.hpp index 06155cf..a90d437 100644 --- a/src/World.hpp +++ b/src/World.hpp @@ -15,20 +15,18 @@ #include "Vector.hpp" class World { - std::map sections; - std::map sectionMutexes; - int dimension = 0; + int dimension = 0; + std::map sections; + std::map cachedSections; - Section ParseSection(StreamInput *data, Vector position); + PackedSection ParseSection(StreamInput *data, Vector position); - void ParserFunc(); + std::vector entities; + + std::mutex entitiesMutex; - std::queue
toParse; - std::mutex parseMutex; + Block& GetBlock(Vector worldPosition); - bool isRunning = true; - std::thread parser; - public: World(); @@ -36,17 +34,17 @@ public: void ParseChunkData(std::shared_ptr packet); - bool isPlayerCollides(double X, double Y, double Z); + void ParseChunkData(std::shared_ptr packet); - Block &GetBlock(Vector pos); + void ParseChunkData(std::shared_ptr packet); - std::vector GetSectionsList(); + bool isPlayerCollides(double X, double Y, double Z); - Section &GetSection(Vector sectionPos); + std::vector GetSectionsList(); - glm::vec3 Raycast(glm::vec3 position, glm::vec3 direction, float maxLength = 1000.0f, float minPrecision = 0.01f); + const Section &GetSection(Vector sectionPos); - std::vector entities; + glm::vec3 Raycast(glm::vec3 position, glm::vec3 direction, float maxLength = 1000.0f, float minPrecision = 0.01f); void UpdatePhysics(float delta); @@ -55,4 +53,6 @@ public: std::vector GetEntitiesList(); void AddEntity(Entity entity); + + void DeleteEntity(unsigned int EntityId); }; \ No newline at end of file -- cgit v1.2.3