]> git.localhorst.tv Git - blank.git/blobdiff - src/ai/Spawner.hpp
split composite model in template and instance
[blank.git] / src / ai / Spawner.hpp
index e3e8f24feea0326322266596576cf9d0e8e770dc..7b56130f5f090aba00cfe9426637b1aa7d7d4bab 100644 (file)
@@ -1,13 +1,17 @@
 #ifndef BLANK_AI_SPAWNER_HPP_
 #define BLANK_AI_SPAWNER_HPP_
 
-#include <list>
+#include "../app/IntervalTimer.hpp"
+#include "../model/CompositeModel.hpp"
+#include "../model/EntityModel.hpp"
+
+#include <vector>
 #include <glm/glm.hpp>
 
 
 namespace blank {
 
-class RandomWalk;
+class Controller;
 class World;
 
 class Spawner {
@@ -19,11 +23,22 @@ public:
        void Update(int dt);
 
 private:
-       void Spawn(const glm::vec3 &);
+       void CheckDespawn() noexcept;
+       void TrySpawn();
+       void Spawn(const glm::ivec3 &, const glm::vec3 &);
 
 private:
        World &world;
-       std::list<RandomWalk> controllers;
+       std::vector<Controller *> controllers;
+
+       EntityModel models[3];
+       CompositeModel skeletons[3];
+
+       IntervalTimer timer;
+       float despawn_range;
+       float spawn_distance;
+       unsigned int max_entities;
+       int chunk_range;
 
 };