#ifndef WORLD_TYPE_HPP_
#define WORLD_TYPE_HPP_

#include <memory>

#include <WorldTypeSettings/WorldTypeSettings.hpp>
#include <Widget/Layout/CompoundWidget/WorldTypeCreationForm/WorldTypeCreationForm.hpp>

/**
 * @brief Abstract base class for different world types.
 */
class WorldType
{
public:
    virtual ~WorldType() = default;

    /**
     * @brief Returns the name of this world type, e.g. "Survival", "Flat".
     */
    virtual std::string_view getName() = 0;

    /**
     * @brief Returns the world creation form for this world type.
     */
    virtual WorldTypeCreationForm* makeCreationForm(std::function<void()> onAccept) = 0;

    /**
     * @brief Deserialize the world type settings for this world type.
     * 
     * Return `nullptr` if the settings are invalid.
     */
    virtual std::shared_ptr<WorldTypeSettings> deserializeSettings(const uint8_t *data, size_t size) = 0;

    /**
     * @brief Parse the world type settings from the command line arguments.
     * 
     * Return `nullptr` if the settings are invalid.
     */
    virtual std::shared_ptr<WorldTypeSettings> parseSettingsFromCmdArgs(const std::string *args, size_t numArgs) = 0;
};

#endif