#pragma once

namespace contouring {

    struct notifier {
        world::chunk_pos last_pos;
        float last_time = 0;

        static constexpr auto INTERVAL = 5;
        bool mustNotify(const world::cell_pos& pos, float deltaTime) {
            const auto cPos = glm::divide(pos);
            if (last_pos != cPos || last_time < deltaTime) {
                last_pos = cPos;
                last_time = INTERVAL;
                return true;
            }
            last_time -= deltaTime;
            return false;
        }
    };

}