X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fai%2FAIController.hpp;fp=src%2Fai%2FAIController.hpp;h=c1241969bdef702ada0225d0952184cd4a5fa986;hb=f0a20986c573c4df1eb1212333489252c4b30efa;hp=8e5073364ac22f9f2da21841cccadc0937b002a5;hpb=0ab149c70b3f984b2cc0c7a122b4aa347bc5fd79;p=blank.git diff --git a/src/ai/AIController.hpp b/src/ai/AIController.hpp index 8e50733..c124196 100644 --- a/src/ai/AIController.hpp +++ b/src/ai/AIController.hpp @@ -1,6 +1,7 @@ #ifndef BLANK_AI_AICONTROLLER_HPP_ #define BLANK_AI_AICONTROLLER_HPP_ +#include "../app/IntervalTimer.hpp" #include "../world/EntityController.hpp" #include @@ -26,6 +27,20 @@ public: 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; @@ -47,11 +62,17 @@ public: 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;