]> git.localhorst.tv Git - blobs.git/blob - src/creature/LocateResourceGoal.hpp
overhaul need system
[blobs.git] / src / creature / LocateResourceGoal.hpp
1 #ifndef BLOBS_CREATURE_LOCATERESOURCEGOAL_HPP_
2 #define BLOBS_CREATURE_LOCATERESOURCEGOAL_HPP_
3
4 #include "Composition.hpp"
5 #include "../math/glm.hpp"
6
7
8 namespace blobs {
9 namespace creature {
10
11 class LocateResourceGoal
12 : public Goal {
13
14 public:
15         LocateResourceGoal(Creature &);
16         ~LocateResourceGoal() noexcept override;
17
18 public:
19         void Accept(int resource, double attractiveness);
20
21         std::string Describe() const override;
22         void Enable() override;
23         void Tick(double dt) override;
24         void Action() override;
25
26 private:
27         void LocateResource();
28         void SearchVicinity();
29         bool OnTargetTile() const noexcept;
30
31 private:
32         Composition accept;
33         bool found;
34         glm::dvec3 target_pos;
35         int target_srf;
36         glm::ivec2 target_tile;
37         bool searching;
38         double reevaluate;
39
40 };
41
42 }
43 }
44
45 #endif