#pragma once #include #include #include #include //hash functions (they should probably get moved at this point, the ones that aren't specifically for EM anyway) #include class TileCache { private: TileCache() = default; std::unordered_map locations; public: static TileCache& Get() { static TileCache instance; return instance; } void cache(const df::coord &pos, df::tiletype type) { locations.emplace(pos, type); } void uncache(const df::coord &pos) { locations.erase(pos); } bool hasChanged(const df::coord &pos, const df::tiletype &type) { return locations.count(pos) && type != locations[pos]; } };