#ifndef BLANK_AI_SPAWNER_HPP_
#define BLANK_AI_SPAWNER_HPP_
-#include <list>
+#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 RandomWalk;
+class Controller;
+class Entity;
class World;
class Spawner {
public:
- explicit Spawner(World &);
+ Spawner(World &, std::uint64_t seed);
~Spawner();
void Update(int dt);
private:
- void Spawn(const glm::vec3 &);
+ void CheckDespawn() noexcept;
+ void TrySpawn();
+ void Spawn(Entity &reference, const glm::ivec3 &, const glm::vec3 &);
private:
World &world;
- std::list<RandomWalk> controllers;
+ std::vector<Controller *> controllers;
+
+ EntityModel models[3];
+ CompositeModel skeletons[3];
+
+ GaloisLFSR random;
+
+ IntervalTimer timer;
+ float despawn_range;
+ float spawn_distance;
+ unsigned int max_entities;
+ int chunk_range;
};