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