#define BLANK_AI_SPAWNER_HPP_
#include "../app/IntervalTimer.hpp"
-#include "../model/CompositeModel.hpp"
-#include "../model/EntityModel.hpp"
-#include "../rand/GaloisLFSR.hpp"
#include <vector>
#include <glm/glm.hpp>
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:
void TrySpawn();
void Spawn(Entity &reference, const glm::ivec3 &, const glm::vec3 &);
+ Model &RandomModel() noexcept;
+
private:
World &world;
- std::vector<Controller *> controllers;
-
- EntityModel models[3];
- CompositeModel skeletons[3];
+ ModelRegistry ⊧
+ std::vector<Entity *> 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;
+
};
}