X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fai%2FSpawner.hpp;h=f99029e28f7fdec7b1f08f34d4ef6ff9ef28d269;hb=fa3c4a14546d73ddc2671cd5cc58208839bf7173;hp=a0da02fb0ec939b4e7a6c8e2375a82b00d83d03a;hpb=aefc5482b27e3d259b6c9f3f1e4cdd9ef2e6a8d2;p=blank.git diff --git a/src/ai/Spawner.hpp b/src/ai/Spawner.hpp index a0da02f..f99029e 100644 --- a/src/ai/Spawner.hpp +++ b/src/ai/Spawner.hpp @@ -3,38 +3,51 @@ #include "../app/IntervalTimer.hpp" -#include +#include #include namespace blank { -class RandomWalk; +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; - std::list controllers; + ModelRegistry ⊧ + std::vector entities; - IntervalTimer timer; + GaloisLFSR &random; + + CoarseTimer timer; float despawn_range; float spawn_distance; unsigned int max_entities; int chunk_range; + std::size_t model_offset; + std::size_t model_length; + }; }