X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fai%2FSpawner.hpp;h=be2ff31b7307e99f484c5b183c788e329d260e82;hb=7e782291e0ce39eb2d4e8c1df28f682c313e6f8d;hp=c55d73c0f7f90b835b5791f69e8c9096e17cc81d;hpb=ad7cf72ed47c39640d5588ba53386e090289b4d1;p=blank.git diff --git a/src/ai/Spawner.hpp b/src/ai/Spawner.hpp index c55d73c..be2ff31 100644 --- a/src/ai/Spawner.hpp +++ b/src/ai/Spawner.hpp @@ -2,7 +2,6 @@ #define BLANK_AI_SPAWNER_HPP_ #include "../app/IntervalTimer.hpp" -#include "../model/EntityModel.hpp" #include #include @@ -11,26 +10,35 @@ 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::ivec3 &, const glm::vec3 &); + void Spawn(Entity &reference, const glm::ivec3 &, const glm::vec3 &); + + Model &RandomModel() noexcept; private: World &world; + ModelRegistry ⊧ std::vector controllers; - EntityModel models[3]; + GaloisLFSR &random; IntervalTimer timer; float despawn_range; @@ -38,6 +46,9 @@ private: unsigned int max_entities; int chunk_range; + std::size_t model_offset; + std::size_t model_length; + }; }