]> git.localhorst.tv Git - blank.git/blobdiff - src/ai/AIController.hpp
AI state machine
[blank.git] / src / ai / AIController.hpp
index 53bdc827a5b3bc8df5b99b4c88553e6dfd5a5361..0eca2b78335b3bbf9094bd3cd03024de8cc7ff65 100644 (file)
@@ -8,6 +8,7 @@
 
 namespace blank {
 
+class AIState;
 class GaloisLFSR;
 
 class AIController
@@ -17,20 +18,38 @@ public:
        explicit AIController(GaloisLFSR &);
        ~AIController();
 
+       void SetState(const AIState &);
+
        void Update(Entity &, float dt) override;
 
        glm::vec3 ControlForce(const EntityState &) const override;
 
        static glm::vec3 Heading(const EntityState &) noexcept;
 
+       void StartFleeing(const Entity &, float speed) noexcept;
+       void StopFleeing() noexcept;
+       bool IsFleeing() const noexcept;
+       const Entity &GetFleeTarget() const noexcept;
+
+       void StartSeeking(const Entity &, float speed) noexcept;
+       void StopSeeking() noexcept;
+       bool IsSeeking() const noexcept;
+       const Entity &GetSeekTarget() const noexcept;
+
+       void StartWandering() noexcept;
+       void StopWandering() noexcept;
+
 private:
        GaloisLFSR &random;
+       const AIState *state;
 
-       float chase_speed;
+       const Entity *flee_target;
        float flee_speed;
-       float stop_dist;
-       float flee_dist;
 
+       const Entity *seek_target;
+       float seek_speed;
+
+       bool wandering;
        glm::vec3 wander_pos;
        float wander_dist;
        float wander_radius;