X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fai%2FSpawner.hpp;h=daa5f7873390b41de1d9be6db9f2f395d8b87fe3;hb=dcd54cacda98c2c0f7cf0c7a9131fb858d8ee10a;hp=a1181d30bf96f77ec0809228f2079c7d0c7fa88f;hpb=dbfcb12348b80e2582f710acb1e4ed0011889ba2;p=blank.git diff --git a/src/ai/Spawner.hpp b/src/ai/Spawner.hpp index a1181d3..daa5f78 100644 --- a/src/ai/Spawner.hpp +++ b/src/ai/Spawner.hpp @@ -2,26 +2,26 @@ #define BLANK_AI_SPAWNER_HPP_ #include "../app/IntervalTimer.hpp" -#include "../model/CompositeModel.hpp" -#include "../model/EntityModel.hpp" -#include "../rand/GaloisLFSR.hpp" +#include "../graphics/glm.hpp" #include -#include namespace blank { -class Controller; class Entity; +class Model; +class ModelRegistry; class World; class Spawner { public: - Spawner(World &, std::uint64_t seed); + Spawner(World &, ModelRegistry &); ~Spawner(); + void LimitModels(std::size_t begin, std::size_t end); + void Update(int dt); private: @@ -29,21 +29,22 @@ private: void TrySpawn(); void Spawn(Entity &reference, const glm::ivec3 &, const glm::vec3 &); + Model &RandomModel() noexcept; + private: World &world; - std::vector controllers; - - EntityModel models[3]; - CompositeModel skeletons[3]; + ModelRegistry ⊧ + std::vector entities; - GaloisLFSR random; - - IntervalTimer timer; + 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; + }; }