#ifndef WORLD_TYPE_REGISTRY_HPP_
#define WORLD_TYPE_REGISTRY_HPP_

#include <unordered_map>
#include <WorldType/WorldType.hpp>

/**
 * @brief Registry of world types.
 */
class WorldTypeRegistry
{
private:
    std::unordered_map<std::string, WorldType*> worldTypes;

    template<typename TWorldType>
    void registerWorldType(std::string id)
    {
        worldTypes[id] = new TWorldType();
    }

public:
    ~WorldTypeRegistry();

    /**
     * @brief Register all of the world types.
     */
    void registerAllWorldTypes();

    /**
     * @brief Get the world type object based on ID.
     */
    WorldType* getByID(std::string id);

    int getTotalWorldTypes();

    friend class WorldCreation;
};

extern WorldTypeRegistry worldTypeRegistry;

#endif