X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld.hpp;h=bca1e0c082e190aadfe147abd2efcd7b852b69d5;hb=bd6bd2c875f4b6baef913e5315aa9f7e7cd7da7a;hp=60ec6f4dbeca36c1b7364f4834ad3cec54a3e3b7;hpb=804bde3fc09e4317eef629861638a68bfad3e343;p=blank.git diff --git a/src/world.hpp b/src/world.hpp index 60ec6f4..bca1e0c 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -3,8 +3,8 @@ #include "block.hpp" #include "chunk.hpp" -#include "controller.hpp" -#include "noise.hpp" +#include "entity.hpp" +#include "generator.hpp" #include "shader.hpp" #include "shape.hpp" @@ -17,9 +17,7 @@ namespace blank { class World { public: - World(); - - void Generate(const glm::tvec3 &from, const glm::tvec3 &to); + explicit World(unsigned int seed); bool Intersection( const Ray &, @@ -30,32 +28,28 @@ public: glm::vec3 *normal = nullptr); BlockTypeRegistry &BlockTypes() { return blockType; } - std::list &LoadedChunks() { return loaded; } - FPSController &Controller() { return player; } + Entity &Player() { return *player; } + Entity &AddEntity() { entities.emplace_back(); return entities.back(); } - Chunk &Next(const Chunk &, const glm::vec3 &dir); + Chunk &PlayerChunk(); + Chunk &Next(const Chunk &to, const glm::tvec3 &dir); void Update(int dt); void Render(DirectionalLighting &); -private: - void Generate(Chunk &); - private: BlockTypeRegistry blockType; CuboidShape blockShape; StairShape stairShape; CuboidShape slabShape; - SimplexNoise blockNoise; - SimplexNoise colorNoise; - - FPSController player; + Generator generate; + ChunkLoader chunks; - std::list loaded; - std::list to_generate; + Entity *player; + std::list entities; };