#pragma once

#include <nlohmann/json.hpp>

#include <filesystem>

#include "Ship/ShipBuilder.h"

using json = nlohmann::json;

class Time;
class Ship;

class ShipJsonBuilder : private ShipBuilder {
public:
    ShipJsonBuilder(const std::filesystem::path& path);

    std::unique_ptr<Ship> buildBrig(Time* time, const std::string& name);
    std::unique_ptr<Ship> buildFrigate(Time* time, const std::string& name);
    std::unique_ptr<Ship> buildGaleon(Time* time, const std::string& name);

private:
    void parseFile(const std::filesystem::path& path);

    json _shipsData;
};