X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fai%2FSpawner.hpp;h=be2ff31b7307e99f484c5b183c788e329d260e82;hb=7e782291e0ce39eb2d4e8c1df28f682c313e6f8d;hp=9fb3d368de0dcd2a02156006422526a54a95a53f;hpb=41652fb3d73f12e6ae4ce7380244a75a4f5c6797;p=blank.git diff --git a/src/ai/Spawner.hpp b/src/ai/Spawner.hpp index 9fb3d36..be2ff31 100644 --- a/src/ai/Spawner.hpp +++ b/src/ai/Spawner.hpp @@ -2,9 +2,6 @@ #define BLANK_AI_SPAWNER_HPP_ #include "../app/IntervalTimer.hpp" -#include "../model/CompositeModel.hpp" -#include "../model/EntityModel.hpp" -#include "../rand/GaloisLFSR.hpp" #include #include @@ -13,29 +10,35 @@ namespace blank { class Controller; +class Entity; +class GaloisLFSR; +class Model; +class ModelRegistry; class World; class Spawner { public: - Spawner(World &, std::uint64_t seed); + 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]; - CompositeModel skeletons[3]; - - GaloisLFSR random; + GaloisLFSR &random; IntervalTimer timer; float despawn_range; @@ -43,6 +46,9 @@ private: unsigned int max_entities; int chunk_range; + std::size_t model_offset; + std::size_t model_length; + }; }