]> git.localhorst.tv Git - blank.git/blob - src/ai/Spawner.hpp
allow multiple meshes per entity
[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/EntityModel.hpp"
6
7 #include <vector>
8 #include <glm/glm.hpp>
9
10
11 namespace blank {
12
13 class Controller;
14 class World;
15
16 class Spawner {
17
18 public:
19         explicit Spawner(World &);
20         ~Spawner();
21
22         void Update(int dt);
23
24 private:
25         void CheckDespawn() noexcept;
26         void TrySpawn();
27         void Spawn(const glm::ivec3 &, const glm::vec3 &);
28
29 private:
30         World &world;
31         std::vector<Controller *> controllers;
32
33         EntityModel models[14];
34
35         IntervalTimer timer;
36         float despawn_range;
37         float spawn_distance;
38         unsigned int max_entities;
39         int chunk_range;
40
41 };
42
43 }
44
45 #endif