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