]> git.localhorst.tv Git - blank.git/blobdiff - src/ai/Spawner.hpp
glm backwards compatibility
[blank.git] / src / ai / Spawner.hpp
index a0da02fb0ec939b4e7a6c8e2375a82b00d83d03a..daa5f7873390b41de1d9be6db9f2f395d8b87fe3 100644 (file)
@@ -2,39 +2,49 @@
 #define BLANK_AI_SPAWNER_HPP_
 
 #include "../app/IntervalTimer.hpp"
+#include "../graphics/glm.hpp"
 
-#include <list>
-#include <glm/glm.hpp>
+#include <vector>
 
 
 namespace blank {
 
-class RandomWalk;
+class Entity;
+class Model;
+class ModelRegistry;
 class World;
 
 class Spawner {
 
 public:
-       explicit Spawner(World &);
+       Spawner(World &, ModelRegistry &);
        ~Spawner();
 
+       void LimitModels(std::size_t begin, std::size_t end);
+
        void Update(int dt);
 
 private:
        void CheckDespawn() noexcept;
        void TrySpawn();
-       void Spawn(const glm::tvec3<int> &, const glm::vec3 &);
+       void Spawn(Entity &reference, const glm::ivec3 &, const glm::vec3 &);
+
+       Model &RandomModel() noexcept;
 
 private:
        World &world;
-       std::list<RandomWalk> controllers;
+       ModelRegistry &models;
+       std::vector<Entity *> entities;
 
-       IntervalTimer timer;
+       CoarseTimer timer;
        float despawn_range;
        float spawn_distance;
        unsigned int max_entities;
        int chunk_range;
 
+       std::size_t model_offset;
+       std::size_t model_length;
+
 };
 
 }