#ifndef MILESTONE_REGISTRY_HPP_
#define MILESTONE_REGISTRY_HPP_

#include <Milestone/Milestone.hpp>
#include <memory>
#include <string>
#include <unordered_map>

extern class MilestoneRegistry
{
private:
    std::unordered_map<std::string, std::unique_ptr<Milestone>> milestones;

    template<typename TMilestone>
    void registerMilestone()
    {
        milestones[TMilestone::ID] = std::make_unique<TMilestone>();
        milestones[TMilestone::ID]->id = TMilestone::ID;
    }

public:
    MilestoneRegistry();

    void registerAllMilestones();
    Milestone& getMilestone(const std::string &milestoneId);
    void getSortedMilestoneList(std::vector<Milestone*> &sortedList);
} milestoneRegistry;

#endif