]> git.localhorst.tv Git - blobs.git/blob - src/creature/Genome.hpp
split creature when it's "ripe" lol
[blobs.git] / src / creature / Genome.hpp
1 #ifndef BLOBS_CREATURE_GENOME_HPP_
2 #define BLOBS_CREATURE_GENOME_HPP_
3
4 #include "../math/Distribution.hpp"
5
6 #include <vector>
7
8
9 namespace blobs {
10 namespace app {
11         struct Assets;
12 }
13 namespace creature {
14
15 class Creature;
16
17 struct Genome {
18
19         template<class T>
20         struct Properties {
21                 T birth_mass;
22                 T fertile_mass;
23                 T max_mass;
24
25                 T fertile_age;
26                 T infertile_age;
27                 T death_age;
28
29                 T fertility;
30         };
31         Properties<math::Distribution> properties;
32
33
34         struct Composition {
35                 // which resource
36                 int resource;
37                 // how much contained in the body
38                 // relative value to determine average density
39                 math::Distribution mass;
40                 // how much to circulate
41                 math::Distribution intake;
42                 // how important for alive-being
43                 math::Distribution penalty;
44                 // how much off the mass may stay in the body
45                 math::Distribution growth;
46         };
47         std::vector<Composition> composition;
48
49         void Configure(Creature &) const;
50
51 };
52
53 }
54 }
55
56 #endif