1 #ifndef BLOBS_CREATURE_NEED_HPP_
2 #define BLOBS_CREATURE_NEED_HPP_
19 // how fast value grows per second
21 // the value at which this need is no longer satisfied
22 double inconvenient = 0.0;
23 // the value at which this need starts to hurt
24 double critical = 0.0;
26 virtual ~Need() noexcept;
28 void Tick(double dt) noexcept;
29 void Increase(double) noexcept;
30 void Decrease(double) noexcept;
32 bool IsSatisfied() const noexcept { return value < inconvenient; }
33 bool IsInconvenient() const noexcept { return value >= inconvenient && value < critical; }
34 bool IsCritical() const noexcept { return value >= critical; }
36 virtual void ApplyEffect(Creature &, double dt) = 0;