]> git.localhorst.tv Git - blobs.git/blob - src/creature/Memory.hpp
track where a creature has been
[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 private:
34         /// track time spent on a tile
35         void TrackStay(const Location &, double t);
36
37 private:
38         Creature &c;
39
40         struct Stay {
41                 double first_been;
42                 Location first_loc;
43                 double last_been;
44                 Location last_loc;
45                 double time_spent;
46         };
47         std::map<int, Stay> known_types;
48
49 };
50
51 }
52 }
53
54 #endif