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;
25 // factor of the intake that may stay in the body
28 virtual ~Need() noexcept;
30 void Tick(double dt) noexcept;
31 void Increase(double) noexcept;
32 void Decrease(double) noexcept;
34 bool IsSatisfied() const noexcept { return value < inconvenient; }
35 bool IsInconvenient() const noexcept { return value >= inconvenient && value < critical; }
36 bool IsCritical() const noexcept { return value >= critical; }
38 virtual void ApplyEffect(Creature &, double dt) = 0;