X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcreature%2FCreature.hpp;h=7c3d1ef0f924cad93614a7c8dba26a59d005fbf5;hb=2025d49798b93180237b6ce62d3ff5d6ee8ebc6e;hp=f4c000408a63fa9f5bee40af3927f34b92403230;hpb=bcf776b6d51aeb9147bde32da8dd0768b10db993;p=blobs.git diff --git a/src/creature/Creature.hpp b/src/creature/Creature.hpp index f4c0004..7c3d1ef 100644 --- a/src/creature/Creature.hpp +++ b/src/creature/Creature.hpp @@ -6,6 +6,7 @@ #include "../graphics/glm.hpp" #include "../graphics/SimpleVAO.hpp" +#include #include #include @@ -41,9 +42,10 @@ public: void Health(double h) noexcept { health = h; } double Health() const noexcept { return health; } + void Hurt(double d) noexcept; - void AddNeed(const Need &n) { needs.push_back(n); } - const std::vector &Needs() const noexcept { return needs; } + void AddNeed(std::unique_ptr &&n) { needs.emplace_back(std::move(n)); } + const std::vector> &Needs() const noexcept { return needs; } void Tick(double dt); @@ -58,7 +60,7 @@ public: private: std::string name; double health; - std::vector needs; + std::vector> needs; Situation situation;