1 #ifndef BLOBS_CREATURE_GOAL_HPP_
2 #define BLOBS_CREATURE_GOAL_HPP_
18 using Callback = std::function<void(Goal &)>;
21 explicit Goal(Creature &);
22 virtual ~Goal() noexcept;
25 Creature &GetCreature() noexcept { return c; }
26 const Creature &GetCreature() const noexcept { return c; }
27 Situation &GetSituation() noexcept;
28 const Situation &GetSituation() const noexcept;
29 Steering &GetSteering() noexcept;
30 const Steering &GetSteering() const noexcept;
32 double Urgency() const noexcept { return urgency; }
33 void Urgency(double u) noexcept { urgency = u; }
35 bool Interruptible() const noexcept { return interruptible; }
36 void Interruptible(bool i) noexcept { interruptible = i; }
38 bool Complete() const noexcept { return complete; }
39 void SetComplete() noexcept;
40 /// only supports one callback for now, new one will replace an old
41 void OnComplete(Callback) noexcept;
44 virtual std::string Describe() const = 0;
45 virtual void Enable() { }
46 virtual void Tick(double dt) { }
47 virtual void Action() { }