]> git.localhorst.tv Git - blobs.git/blob - src/creature/Memory.hpp
c58fd26420576067d0688df153da1b5b0b6dd5df
[blobs.git] / src / creature / Memory.hpp
1 #ifndef BLOBS_CREATURE_MEMORY_HPP_
2 #define BLOBS_CREATURE_MEMORY_HPP_
3
4 #include "../math/glm.hpp"
5
6 #include <map>
7
8
9 namespace blobs {
10 namespace world {
11         class Planet;
12 }
13 namespace creature {
14
15 class Creature;
16
17 class Memory {
18
19 public:
20         struct Location {
21                 world::Planet *planet;
22                 glm::dvec3 position;
23         };
24
25 public:
26         explicit Memory(Creature &);
27         ~Memory();
28
29 public:
30         void Tick(double dt);
31
32         void Erase();
33
34 private:
35         /// track time spent on a tile
36         void TrackStay(const Location &, double t);
37
38 private:
39         Creature &c;
40
41         struct Stay {
42                 double first_been;
43                 Location first_loc;
44                 double last_been;
45                 Location last_loc;
46                 double time_spent;
47         };
48         std::map<int, Stay> known_types;
49
50 };
51
52 }
53 }
54
55 #endif