#pragma once #include #include #include #include class TileCache { private: TileCache() = default; std::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) { if (locations.count(pos)) { if (type != locations.find(pos)->second){ return true; } } return false; } };