//
// Created by m on 12/13/21.
//

#include "algorithmmanager.hpp"

#include <utility>

void AlgorithmManager::register_algorithm(std::string name, sol::function initialize, sol::function update,
                                          unsigned int updates_per_second) {
    unsigned int frames_per_update = target_fps / updates_per_second;
    DungeonAlgorithm algorithm = {
            frames_per_update,
            std::move(update),
            std::move(initialize),
            std::move(name)
    };
    algorithms.push_back(algorithm);

}

ranges::any_view<DungeonAlgorithm> AlgorithmManager::get_algorithms() {
    return algorithms;
}
