diff --git a/bin/config/buildings.toml b/bin/app/data/config/buildings.toml similarity index 100% rename from bin/config/buildings.toml rename to bin/app/data/config/buildings.toml diff --git a/bin/config/recipes.toml b/bin/app/data/config/recipes.toml similarity index 100% rename from bin/config/recipes.toml rename to bin/app/data/config/recipes.toml diff --git a/bin/config/ships.toml b/bin/app/data/config/ships.toml similarity index 100% rename from bin/config/ships.toml rename to bin/app/data/config/ships.toml diff --git a/bin/config/stations.toml b/bin/app/data/config/stations.toml similarity index 100% rename from bin/config/stations.toml rename to bin/app/data/config/stations.toml diff --git a/bin/config/visuals.toml b/bin/app/data/config/visuals.toml similarity index 100% rename from bin/config/visuals.toml rename to bin/app/data/config/visuals.toml diff --git a/bin/config/world.toml b/bin/app/data/config/world.toml similarity index 100% rename from bin/config/world.toml rename to bin/app/data/config/world.toml diff --git a/src/test/config/buildings.toml b/bin/test/data/config/buildings.toml similarity index 100% rename from src/test/config/buildings.toml rename to bin/test/data/config/buildings.toml diff --git a/src/test/config/recipes.toml b/bin/test/data/config/recipes.toml similarity index 100% rename from src/test/config/recipes.toml rename to bin/test/data/config/recipes.toml diff --git a/src/test/config/ships.toml b/bin/test/data/config/ships.toml similarity index 100% rename from src/test/config/ships.toml rename to bin/test/data/config/ships.toml diff --git a/src/test/config/stations.toml b/bin/test/data/config/stations.toml similarity index 100% rename from src/test/config/stations.toml rename to bin/test/data/config/stations.toml diff --git a/src/test/config/world.toml b/bin/test/data/config/world.toml similarity index 100% rename from src/test/config/world.toml rename to bin/test/data/config/world.toml diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6fd2d53..d46a1fb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -177,7 +177,7 @@ set_target_properties(${TARGET_APP_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${OUTPUT_ROOT_PATH}/$(Configuration)/app/" ) target_compile_definitions(${TARGET_APP_NAME} PRIVATE - DOTA_FACTORY_CONFIG_DIR="${CMAKE_SOURCE_DIR}/bin/config" + CONFIG_DIR="${CMAKE_SOURCE_DIR}/bin/app/data/config" ) target_link_libraries(${TARGET_APP_NAME} ${TARGET_UI_NAME}) @@ -206,7 +206,7 @@ set_property(TARGET ${TARGET_TEST_NAME} PROPERTY INCLUDE_DIRECTORIES "${LIB_INCLUDE_PATH}" ) target_compile_definitions(${TARGET_TEST_NAME} PRIVATE - DOTA_FACTORY_CONFIG_DIR="${CMAKE_SOURCE_DIR}/src/test/config" + CONFIG_DIR="${CMAKE_SOURCE_DIR}/bin/test/data/config" ) target_link_libraries(${TARGET_TEST_NAME} ${TARGET_LIB_NAME}) diff --git a/src/app/main.cpp b/src/app/main.cpp index 37d11a9..2657167 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -31,10 +31,10 @@ int main(int argc, char *argv[]) QDir().mkdir(dataDir.dirName()); } - GameConfig config = ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); + GameConfig config = ConfigLoader::loadFromDirectory(CONFIG_DIR); std::unique_ptr sim = std::make_unique(std::move(config)); - MainWindow window(sim.get(), std::string(DOTA_FACTORY_CONFIG_DIR)); + MainWindow window(sim.get(), std::string(CONFIG_DIR)); window.show(); const int ret = application.exec(); diff --git a/src/test/BehaviorSystemTest.cpp b/src/test/BehaviorSystemTest.cpp index c4e8aba..fa42d38 100644 --- a/src/test/BehaviorSystemTest.cpp +++ b/src/test/BehaviorSystemTest.cpp @@ -22,7 +22,7 @@ static GameConfig loadConfig() { - return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); + return ConfigLoader::loadFromDirectory(CONFIG_DIR); } struct Fixture diff --git a/src/test/BlueprintTest.cpp b/src/test/BlueprintTest.cpp index 90d4647..bac5816 100644 --- a/src/test/BlueprintTest.cpp +++ b/src/test/BlueprintTest.cpp @@ -144,7 +144,7 @@ static void applyRotationCCW(Blueprint& bp, const GameConfig& cfg) static GameConfig loadConfig() { - return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); + return ConfigLoader::loadFromDirectory(CONFIG_DIR); } // Mirrors BlueprintPanel::createBlueprintFromSelection's player-placeable filter: diff --git a/src/test/BuildingTest.cpp b/src/test/BuildingTest.cpp index d49b201..b918329 100644 --- a/src/test/BuildingTest.cpp +++ b/src/test/BuildingTest.cpp @@ -24,7 +24,7 @@ static GameConfig loadConfig() { - return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); + return ConfigLoader::loadFromDirectory(CONFIG_DIR); } static Item makeItem(const std::string& id) diff --git a/src/test/CombatSystemTest.cpp b/src/test/CombatSystemTest.cpp index 3892939..8d79e62 100644 --- a/src/test/CombatSystemTest.cpp +++ b/src/test/CombatSystemTest.cpp @@ -17,7 +17,7 @@ static GameConfig loadConfig() { - return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); + return ConfigLoader::loadFromDirectory(CONFIG_DIR); } // Find the first ShipDef with a combat component. diff --git a/src/test/ConfigLoaderTest.cpp b/src/test/ConfigLoaderTest.cpp index 71f70eb..544b75b 100644 --- a/src/test/ConfigLoaderTest.cpp +++ b/src/test/ConfigLoaderTest.cpp @@ -64,7 +64,7 @@ private: TEST_CASE("ConfigLoader loads the committed bin/config/ configs end-to-end", "[config]") { - const std::string configDir = DOTA_FACTORY_CONFIG_DIR; + const std::string configDir = CONFIG_DIR; const GameConfig cfg = ConfigLoader::loadFromDirectory(configDir); // world.toml diff --git a/src/test/ShipTest.cpp b/src/test/ShipTest.cpp index ffd557d..1601df9 100644 --- a/src/test/ShipTest.cpp +++ b/src/test/ShipTest.cpp @@ -15,7 +15,7 @@ static GameConfig loadConfig() { - return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); + return ConfigLoader::loadFromDirectory(CONFIG_DIR); } // --------------------------------------------------------------------------- @@ -192,3 +192,4 @@ TEST_CASE("ShipSystem: despawn removes the ship", "[ship]") ss.despawn(id); REQUIRE(ss.findShip(id) == nullptr); } + diff --git a/src/test/ShipyardTest.cpp b/src/test/ShipyardTest.cpp index fd8d676..e7d5db7 100644 --- a/src/test/ShipyardTest.cpp +++ b/src/test/ShipyardTest.cpp @@ -14,7 +14,7 @@ static GameConfig loadConfig() { - return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); + return ConfigLoader::loadFromDirectory(CONFIG_DIR); } static const ShipDef* findAvailableSchematic(const GameConfig& cfg) diff --git a/src/test/SimulationTest.cpp b/src/test/SimulationTest.cpp index aab9528..c1a578b 100644 --- a/src/test/SimulationTest.cpp +++ b/src/test/SimulationTest.cpp @@ -8,7 +8,7 @@ static GameConfig loadConfig() { - return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); + return ConfigLoader::loadFromDirectory(CONFIG_DIR); } // --------------------------------------------------------------------------- diff --git a/src/test/WaveSystemTest.cpp b/src/test/WaveSystemTest.cpp index 79b18dc..55186fd 100644 --- a/src/test/WaveSystemTest.cpp +++ b/src/test/WaveSystemTest.cpp @@ -15,7 +15,7 @@ static GameConfig loadConfig() { - return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); + return ConfigLoader::loadFromDirectory(CONFIG_DIR); } // ---------------------------------------------------------------------------