]> git.localhorst.tv Git - blobs.git/blob - src/creature/Memory.hpp
track a few things
[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                 int surface;
23                 glm::ivec2 coords;
24         };
25
26 public:
27         explicit Memory(Creature &);
28         ~Memory();
29
30 public:
31         void Tick(double dt);
32
33         void Erase();
34
35 private:
36         /// track time spent on a tile
37         void TrackStay(const Location &, double t);
38
39 private:
40         Creature &c;
41
42         struct Stay {
43                 double first_been;
44                 Location first_loc;
45                 double last_been;
46                 Location last_loc;
47                 double time_spent;
48         };
49         std::map<int, Stay> known_types;
50
51 };
52
53 }
54 }
55
56 #endif