X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcreature%2FLocateResourceGoal.hpp;h=bbb636e8614c60105f8b345a302d5ddd605700fc;hb=c49dd02dfabb123e0c6c4b49f761ce6578dfc464;hp=c69e3e687af3cdee4ade75e01586b0ffb60ad792;hpb=da5e275f10252813b4de3af5e58f0c7975468962;p=blobs.git diff --git a/src/creature/LocateResourceGoal.hpp b/src/creature/LocateResourceGoal.hpp index c69e3e6..bbb636e 100644 --- a/src/creature/LocateResourceGoal.hpp +++ b/src/creature/LocateResourceGoal.hpp @@ -1,6 +1,7 @@ #ifndef BLOBS_CREATURE_LOCATERESOURCEGOAL_HPP_ #define BLOBS_CREATURE_LOCATERESOURCEGOAL_HPP_ +#include "Composition.hpp" #include "../math/glm.hpp" @@ -11,10 +12,13 @@ class LocateResourceGoal : public Goal { public: - LocateResourceGoal(Creature &, int resource); + LocateResourceGoal(Creature &); ~LocateResourceGoal() noexcept override; public: + void SetMinimum(double m) noexcept { minimum = m; } + void Accept(int resource, double attractiveness); + std::string Describe() const override; void Enable() override; void Tick(double dt) override; @@ -23,16 +27,17 @@ public: private: void LocateResource(); void SearchVicinity(); - bool OnTargetTile() const noexcept; + void Remember(); + void RandomWalk(); + bool NearTarget() const noexcept; private: - int res; + Composition accept; bool found; glm::dvec3 target_pos; - int target_srf; - glm::ivec2 target_tile; bool searching; double reevaluate; + double minimum; };