#include <WorldComponentRegistry/WorldComponentRegistry.hpp>
#include <WorldComponent/Wiring/ElectricWiring/ElectricWiring.hpp>
#include <WorldComponent/Wiring/FluidWiring/FluidWiring.hpp>
#include <WorldComponent/Wiring/DataWiring/DataWiring.hpp>

WorldComponentRegistry worldComponentRegistry;

void WorldComponentRegistry::registerAllComponents()
{
    registerComponent<ElectricWiring>();
    registerComponent<FluidWiring>();
    registerComponent<DataWiring>();
}

void WorldComponentRegistry::loadComponents(
    AtomicDataStore &manager,
    const std::string &baseDir,
    std::vector<std::unique_ptr<WorldComponent>> &outComps
)
{
    outComps.reserve(components.size());

    for (const Factory &factory : components)
    {
        outComps.push_back(factory(manager, baseDir));
    }
}