add basic types and fix cmake
This commit is contained in:
24
src/lib/config/ConfigLoader.h
Normal file
24
src/lib/config/ConfigLoader.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "GameConfig.h"
|
||||
|
||||
// Parses the five 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);
|
||||
};
|
||||
Reference in New Issue
Block a user