#pragma once #include #include #include class Chunk; enum class LevelEventType { CHUNK_SHOWN, CHUNK_HIDDEN, CHUNK_PRESENT, CHUNK_UNLOAD, }; using ChunkEventFunc = std::function; class LevelEvents { std::unordered_map> chunk_callbacks; public: void listen(LevelEventType type, const ChunkEventFunc& func); void trigger(LevelEventType type, Chunk* chunk); };