X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fai%2FSpawner.hpp;h=be2ff31b7307e99f484c5b183c788e329d260e82;hb=7e782291e0ce39eb2d4e8c1df28f682c313e6f8d;hp=120db6003424a1dfa91a0e0e387a502b5733554c;hpb=c52405fad9c070e1370f852234c6eb723b52916c;p=blank.git diff --git a/src/ai/Spawner.hpp b/src/ai/Spawner.hpp index 120db60..be2ff31 100644 --- a/src/ai/Spawner.hpp +++ b/src/ai/Spawner.hpp @@ -10,31 +10,45 @@ namespace blank { class Controller; +class Entity; +class GaloisLFSR; +class Model; +class ModelRegistry; class World; class Spawner { public: - explicit Spawner(World &); + Spawner(World &, ModelRegistry &, GaloisLFSR &); ~Spawner(); + void LimitModels(std::size_t begin, std::size_t end); + void Update(int dt); private: void CheckDespawn() noexcept; void TrySpawn(); - void Spawn(const glm::tvec3 &, const glm::vec3 &); + void Spawn(Entity &reference, const glm::ivec3 &, const glm::vec3 &); + + Model &RandomModel() noexcept; private: World &world; + ModelRegistry ⊧ std::vector controllers; + GaloisLFSR &random; + IntervalTimer timer; float despawn_range; float spawn_distance; unsigned int max_entities; int chunk_range; + std::size_t model_offset; + std::size_t model_length; + }; }