summary refs log tree commit diff stats
path: root/src/simulation.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2019-02-16 12:12:42 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2019-02-16 12:12:42 -0500
commit9d9fe5b1d8ac5f8c7fe03e0d77591e71acf41af7 (patch)
tree72d0331ec91b4fb193c5733ddddc953d19eda9d1 /src/simulation.h
parenta34396730c8d993fea84a454690bd13ea9a9b403 (diff)
downloaddispatcher-9d9fe5b1d8ac5f8c7fe03e0d77591e71acf41af7.tar.gz
dispatcher-9d9fe5b1d8ac5f8c7fe03e0d77591e71acf41af7.tar.bz2
dispatcher-9d9fe5b1d8ac5f8c7fe03e0d77591e71acf41af7.zip
Pushing works now
Diffstat (limited to 'src/simulation.h')
-rw-r--r--src/simulation.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/simulation.h b/src/simulation.h index bc47642..2f80f9f 100644 --- a/src/simulation.h +++ b/src/simulation.h
@@ -6,6 +6,8 @@
6#include <vector> 6#include <vector>
7#include <deque> 7#include <deque>
8#include <set> 8#include <set>
9#include <unordered_map>
10#include <unordered_set>
9 11
10class Level; 12class Level;
11 13
@@ -45,13 +47,26 @@ public:
45 return level_; 47 return level_;
46 } 48 }
47 49
50 void setGridPos(id_type id, vec2s pos);
51
48private: 52private:
49 53
54
55
56 const std::unordered_set<id_type>& getGridEntities(vec2s pos) const;
57
58 bool moveEntityOnGrid(
59 id_type id,
60 Direction moveDir,
61 bool validate = false);
62
50 const Level& level_; 63 const Level& level_;
51 64
52 std::vector<Entity> entities_; 65 std::vector<Entity> entities_;
53 std::deque<id_type> available_; 66 std::deque<id_type> available_;
54 std::set<id_type> active_; 67 std::set<id_type> active_;
68
69 mutable std::unordered_map<size_t, std::unordered_set<id_type>> gridCache_;
55}; 70};
56 71
57#endif /* end of include guard: SIMULATION_H_7BF6EEA4 */ 72#endif /* end of include guard: SIMULATION_H_7BF6EEA4 */