#pragma once

#include <functional>
#include <unordered_map>
#include <vector>

class Chunk;

enum LevelEventType {
    EVT_CHUNK_SHOWN,
    EVT_CHUNK_HIDDEN,
};

using ChunkEventFunc = std::function<void(LevelEventType, Chunk*)>;

class LevelEvents {
    std::unordered_map<LevelEventType, std::vector<ChunkEventFunc>>
        chunk_callbacks;
public:
    void listen(LevelEventType type, const ChunkEventFunc& func);
    void trigger(LevelEventType type, Chunk* chunk);
};
