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