#pragma once #include #include #include "map.hpp" #include "dinkyecs.hpp" #include struct PointHash { size_t operator()(const Point& p) const { return std::hash()(p.x) ^ std::hash()(p.y); } }; typedef std::vector FoundList; class SpatialHashTable { public: SpatialHashTable() {} // disable copying, I think? SpatialHashTable(SpatialHashTable &other) = delete; void insert(Point pos, DinkyECS::Entity obj); void move(Point from, Point to, DinkyECS::Entity ent); void remove(Point pos); bool occupied(Point pos); std::tuple neighbors(Point position); private: std::unordered_map table; };