Files
dota_factory/src/lib/config/ConfigLoader.h
2026-05-18 08:54:26 +02:00

26 lines
919 B
C++

#pragma once
#include <string>
#include "GameConfig.h"
// Parses all simulation TOML files from a directory and returns a fully
// populated, immutable GameConfig. Throws std::runtime_error on any parse or
// validation failure; the exception message identifies the offending file,
// field, or formula (see architecture.md "Config Loading").
//
// Per-file helpers are exposed so tests can exercise individual loaders in
// isolation.
class ConfigLoader
{
public:
static GameConfig loadFromDirectory(const std::string& configDir);
static WorldConfig loadWorld(const std::string& path);
static BuildingsConfig loadBuildings(const std::string& path);
static RecipesConfig loadRecipes(const std::string& path);
static ShipsConfig loadShips(const std::string& path);
static StationsConfig loadStations(const std::string& path);
static ModulesConfig loadModules(const std::string& path);
};