]> git.localhorst.tv Git - blobs.git/blob - src/creature/Need.hpp
basic needs
[blobs.git] / src / creature / Need.hpp
1 #ifndef BLOBS_CREATURE_NEED_HPP_
2 #define BLOBS_CREATURE_NEED_HPP_
3
4 namespace blobs {
5 namespace creature {
6
7 struct Need {
8
9         int resource = -1;
10         double value = 0.0;
11
12         // how fast value grows per second
13         double gain = 0.0;
14         // the value at which this need is no longer satisfied
15         double critical = 0.0;
16         // the price to pay for not satsfying the need
17         double penalty = 0.0;
18
19         void Tick(double dt) noexcept;
20
21         bool IsSatisfied() const noexcept { return value < critical; }
22
23 };
24
25 }
26 }
27
28 #endif