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