#ifndef BLANK_AI_AICONTROLLER_HPP_
#define BLANK_AI_AICONTROLLER_HPP_
+#include "../app/IntervalTimer.hpp"
#include "../world/EntityController.hpp"
#include <glm/glm.hpp>
static glm::vec3 Heading(const EntityState &) noexcept;
+ /// schedule a decision in the next minimum ± variance seconds
+ void CueDecision(
+ float minimum,
+ float variance
+ ) noexcept;
+ /// check if the scheduled decision is due already
+ bool DecisionDue() const noexcept;
+ /// random choice of 0 to num_choices - 1
+ unsigned int Decide(unsigned int num_choices) noexcept;
+
+ void EnterHalt(float speed) noexcept;
+ void ExitHalt() noexcept;
+ bool IsHalted() const noexcept;
+
void StartFleeing(const Entity &, float speed) noexcept;
void StopFleeing() noexcept;
bool IsFleeing() const noexcept;
float displacement = 1.0f
) noexcept;
void StopWandering() noexcept;
+ bool IsWandering() const noexcept;
private:
GaloisLFSR &random;
const AIState *state;
+ FineTimer decision_timer;
+
+ bool halted;
+ float halt_speed;
+
const Entity *flee_target;
float flee_speed;