]> git.localhorst.tv Git - blank.git/blob - src/ai/Spawner.hpp
split composite model in template and instance
[blank.git] / src / ai / Spawner.hpp
1 #ifndef BLANK_AI_SPAWNER_HPP_
2 #define BLANK_AI_SPAWNER_HPP_
3
4 #include "../app/IntervalTimer.hpp"
5 #include "../model/CompositeModel.hpp"
6 #include "../model/EntityModel.hpp"
7
8 #include <vector>
9 #include <glm/glm.hpp>
10
11
12 namespace blank {
13
14 class Controller;
15 class World;
16
17 class Spawner {
18
19 public:
20         explicit Spawner(World &);
21         ~Spawner();
22
23         void Update(int dt);
24
25 private:
26         void CheckDespawn() noexcept;
27         void TrySpawn();
28         void Spawn(const glm::ivec3 &, const glm::vec3 &);
29
30 private:
31         World &world;
32         std::vector<Controller *> controllers;
33
34         EntityModel models[3];
35         CompositeModel skeletons[3];
36
37         IntervalTimer timer;
38         float despawn_range;
39         float spawn_distance;
40         unsigned int max_entities;
41         int chunk_range;
42
43 };
44
45 }
46
47 #endif