]> git.localhorst.tv Git - blank.git/blob - src/ai/Spawner.hpp
give unique IDs to entities
[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 #include "../rand/GaloisLFSR.hpp"
8
9 #include <vector>
10 #include <glm/glm.hpp>
11
12
13 namespace blank {
14
15 class Controller;
16 class Entity;
17 class World;
18
19 class Spawner {
20
21 public:
22         Spawner(World &, std::uint64_t seed);
23         ~Spawner();
24
25         void Update(int dt);
26
27 private:
28         void CheckDespawn() noexcept;
29         void TrySpawn();
30         void Spawn(Entity &reference, const glm::ivec3 &, const glm::vec3 &);
31
32 private:
33         World &world;
34         std::vector<Controller *> controllers;
35
36         EntityModel models[3];
37         CompositeModel skeletons[3];
38
39         GaloisLFSR random;
40
41         IntervalTimer timer;
42         float despawn_range;
43         float spawn_distance;
44         unsigned int max_entities;
45         int chunk_range;
46
47 };
48
49 }
50
51 #endif