]> git.localhorst.tv Git - blank.git/blobdiff - src/world.hpp
get world seed from command line arguments
[blank.git] / src / world.hpp
index ccd743dd4f1321955410ef1e055f5354140bdb16..bca1e0c082e190aadfe147abd2efcd7b852b69d5 100644 (file)
@@ -8,6 +8,7 @@
 #include "shader.hpp"
 #include "shape.hpp"
 
+#include <list>
 #include <glm/glm.hpp>
 
 
@@ -16,7 +17,7 @@ namespace blank {
 class World {
 
 public:
-       World();
+       explicit World(unsigned int seed);
 
        bool Intersection(
                const Ray &,
@@ -28,8 +29,10 @@ public:
 
        BlockTypeRegistry &BlockTypes() { return blockType; }
 
-       Entity &Player() { return player; }
+       Entity &Player() { return *player; }
+       Entity &AddEntity() { entities.emplace_back(); return entities.back(); }
 
+       Chunk &PlayerChunk();
        Chunk &Next(const Chunk &to, const glm::tvec3<int> &dir);
 
        void Update(int dt);
@@ -45,7 +48,8 @@ private:
        Generator generate;
        ChunkLoader chunks;
 
-       Entity player;
+       Entity *player;
+       std::list<Entity> entities;
 
 };