X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fcreature%2FCreature.hpp;h=3cff2e04cd5264aefab4510679d4abf80bca5f59;hp=d3cd86c462a7d8f22933ab2b8a0da41673a0ce25;hb=27cbcf62c4608f9d3a408e903863f3f5e7e47ff0;hpb=b03c2f42ba325ab909b159a4bc8e7568defdc4c5 diff --git a/src/creature/Creature.hpp b/src/creature/Creature.hpp index d3cd86c..3cff2e0 100644 --- a/src/creature/Creature.hpp +++ b/src/creature/Creature.hpp @@ -77,8 +77,10 @@ public: double Age() const noexcept; std::string AgeName() const; double AgeLerp(double from, double to) const noexcept; - // change of giving birth per tick + // chance of giving birth per tick double Fertility() const noexcept; + // chance of random genetic mutation per tick + double Mutability() const noexcept; void Health(double h) noexcept { health = h; } double Health() const noexcept { return health; } @@ -91,6 +93,10 @@ public: Memory &GetMemory() noexcept { return memory; } const Memory &GetMemory() const noexcept { return memory; } + /// constantly active goal. every creature in the simulation is required to have one + void SetBackgroundTask(std::unique_ptr &&g) { bg_task = std::move(g); } + Goal &BackgroundTask() { return *bg_task; } + void AddNeed(std::unique_ptr &&n) { needs.emplace_back(std::move(n)); } const std::vector> &Needs() const noexcept { return needs; } @@ -135,6 +141,7 @@ private: Memory memory; + std::unique_ptr bg_task; std::vector> needs; std::vector> goals;