fix config data paths
This commit is contained in:
@@ -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})
|
||||
|
||||
|
||||
@@ -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<Simulation> sim = std::make_unique<Simulation>(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();
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
static GameConfig loadConfig()
|
||||
{
|
||||
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR);
|
||||
return ConfigLoader::loadFromDirectory(CONFIG_DIR);
|
||||
}
|
||||
|
||||
struct Fixture
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
static GameConfig loadConfig()
|
||||
{
|
||||
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR);
|
||||
return ConfigLoader::loadFromDirectory(CONFIG_DIR);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
static GameConfig loadConfig()
|
||||
{
|
||||
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR);
|
||||
return ConfigLoader::loadFromDirectory(CONFIG_DIR);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
[[building]]
|
||||
id = "belt"
|
||||
cost = 2
|
||||
player_placeable = true
|
||||
construction_time_seconds = 1
|
||||
surface_mask = ["A>"]
|
||||
|
||||
[[building]]
|
||||
id = "splitter"
|
||||
cost = 3
|
||||
player_placeable = true
|
||||
construction_time_seconds = 1
|
||||
surface_mask = ["<A>"]
|
||||
|
||||
[[building]]
|
||||
id = "tunnel_entry"
|
||||
cost = 5
|
||||
player_placeable = true
|
||||
construction_time_seconds = 3
|
||||
surface_mask = ["A>"]
|
||||
|
||||
[[building]]
|
||||
id = "tunnel_exit"
|
||||
cost = 5
|
||||
player_placeable = true
|
||||
construction_time_seconds = 3
|
||||
surface_mask = ["A>"]
|
||||
|
||||
[[building]]
|
||||
id = "miner"
|
||||
cost = 15
|
||||
player_placeable = true
|
||||
construction_time_seconds = 10
|
||||
surface_mask = [
|
||||
"AA",
|
||||
"A>",
|
||||
]
|
||||
|
||||
[[building]]
|
||||
id = "smelter"
|
||||
cost = 20
|
||||
player_placeable = true
|
||||
construction_time_seconds = 15
|
||||
surface_mask = [
|
||||
"AA ",
|
||||
"AA>",
|
||||
]
|
||||
|
||||
[[building]]
|
||||
id = "assembler"
|
||||
cost = 35
|
||||
player_placeable = true
|
||||
construction_time_seconds = 20
|
||||
surface_mask = [
|
||||
"AAA ",
|
||||
"AAA>",
|
||||
"AAA ",
|
||||
]
|
||||
|
||||
[[building]]
|
||||
id = "reprocessing_plant"
|
||||
cost = 40
|
||||
player_placeable = true
|
||||
construction_time_seconds = 25
|
||||
surface_mask = [
|
||||
"AAA ",
|
||||
"AAA>",
|
||||
"AAA ",
|
||||
]
|
||||
|
||||
[[building]]
|
||||
id = "shipyard"
|
||||
cost = 60
|
||||
player_placeable = true
|
||||
construction_time_seconds = 30
|
||||
surface_mask = [
|
||||
"AAAS>",
|
||||
"AAAS ",
|
||||
]
|
||||
|
||||
[[building]]
|
||||
id = "salvage_bay"
|
||||
cost = 25
|
||||
player_placeable = true
|
||||
construction_time_seconds = 15
|
||||
surface_mask = [
|
||||
"SAA",
|
||||
"SAA>",
|
||||
]
|
||||
@@ -1,62 +0,0 @@
|
||||
[[recipe]]
|
||||
id = "mine_iron_ore"
|
||||
building = "miner"
|
||||
inputs = []
|
||||
outputs = [{item = "iron_ore", amount = 1}]
|
||||
duration_seconds = 1.0
|
||||
|
||||
[[recipe]]
|
||||
id = "mine_copper_ore"
|
||||
building = "miner"
|
||||
inputs = []
|
||||
outputs = [{item = "copper_ore", amount = 1}]
|
||||
duration_seconds = 1.5
|
||||
|
||||
[[recipe]]
|
||||
id = "iron_ingot"
|
||||
building = "smelter"
|
||||
inputs = [{item = "iron_ore", amount = 2}]
|
||||
outputs = [{item = "iron_ingot", amount = 1}]
|
||||
duration_seconds = 2.0
|
||||
|
||||
[[recipe]]
|
||||
id = "copper_ingot"
|
||||
building = "smelter"
|
||||
inputs = [{item = "copper_ore", amount = 2}]
|
||||
outputs = [{item = "copper_ingot", amount = 1}]
|
||||
duration_seconds = 2.5
|
||||
|
||||
[[recipe]]
|
||||
id = "circuit_board"
|
||||
building = "assembler"
|
||||
inputs = [{item = "iron_ingot", amount = 3}, {item = "copper_ingot", amount = 2}]
|
||||
outputs = [{item = "circuit_board", amount = 1}]
|
||||
duration_seconds = 5.0
|
||||
|
||||
[[recipe]]
|
||||
id = "building_blocks"
|
||||
building = "assembler"
|
||||
inputs = [{item = "iron_ingot", amount = 4}]
|
||||
outputs = [{item = "building_block", amount = 10}]
|
||||
duration_seconds = 4.0
|
||||
|
||||
[[recipe]]
|
||||
id = "reprocessing_cycle"
|
||||
building = "reprocessing_plant"
|
||||
inputs = [{item = "scrap", amount = 5}]
|
||||
duration_seconds = 3.0
|
||||
|
||||
[[recipe.outputs]]
|
||||
item = "iron_ingot"
|
||||
amount = 2
|
||||
probability = 0.6
|
||||
|
||||
[[recipe.outputs]]
|
||||
item = "circuit_board"
|
||||
amount = 1
|
||||
probability = 0.3
|
||||
|
||||
[[recipe.outputs]]
|
||||
item = "advanced_alloy"
|
||||
amount = 1
|
||||
probability = 0.1
|
||||
@@ -1,116 +0,0 @@
|
||||
[[ship]]
|
||||
id = "interceptor"
|
||||
available_from_start = true
|
||||
|
||||
[ship.schematic]
|
||||
materials = [{item = "iron_ingot", amount = 3}, {item = "circuit_board", amount = 1}]
|
||||
player_production_level = 3
|
||||
production_time_seconds = 10
|
||||
|
||||
[ship.threat]
|
||||
cost_formula = "5 + 1*x"
|
||||
|
||||
[ship.health]
|
||||
hp_formula = "40 + 5*x"
|
||||
|
||||
[ship.movement]
|
||||
speed_formula = "200 + 5*x"
|
||||
|
||||
[ship.sensor]
|
||||
sensor_range_formula = "200"
|
||||
|
||||
[ship.combat]
|
||||
damage_formula = "10 + 2*x"
|
||||
attack_range_formula = "150"
|
||||
attack_rate_formula = "2.0"
|
||||
|
||||
[ship.loot]
|
||||
scrap_drop = 2
|
||||
|
||||
|
||||
[[ship]]
|
||||
id = "destroyer"
|
||||
available_from_start = true
|
||||
|
||||
[ship.schematic]
|
||||
materials = [{item = "iron_ingot", amount = 5}, {item = "circuit_board", amount = 2}]
|
||||
player_production_level = 5
|
||||
production_time_seconds = 20
|
||||
|
||||
[ship.threat]
|
||||
cost_formula = "10 + 2*x"
|
||||
|
||||
[ship.health]
|
||||
hp_formula = "120 + 15*x"
|
||||
|
||||
[ship.movement]
|
||||
speed_formula = "120"
|
||||
|
||||
[ship.sensor]
|
||||
sensor_range_formula = "300"
|
||||
|
||||
[ship.combat]
|
||||
damage_formula = "12 + 2*x"
|
||||
attack_range_formula = "250"
|
||||
attack_rate_formula = "1.0"
|
||||
|
||||
[ship.loot]
|
||||
scrap_drop = 4
|
||||
|
||||
|
||||
[[ship]]
|
||||
id = "salvage_ship"
|
||||
available_from_start = true
|
||||
|
||||
[ship.schematic]
|
||||
materials = [{item = "iron_ingot", amount = 4}]
|
||||
player_production_level = 3
|
||||
production_time_seconds = 10
|
||||
|
||||
[ship.threat]
|
||||
cost_formula = "0"
|
||||
|
||||
[ship.health]
|
||||
hp_formula = "40 + 4*x"
|
||||
|
||||
[ship.movement]
|
||||
speed_formula = "110"
|
||||
|
||||
[ship.sensor]
|
||||
sensor_range_formula = "250"
|
||||
|
||||
[ship.salvage]
|
||||
collection_range = 50
|
||||
cargo_capacity = 10
|
||||
|
||||
[ship.loot]
|
||||
scrap_drop = 2
|
||||
|
||||
|
||||
[[ship]]
|
||||
id = "repair_ship"
|
||||
available_from_start = false
|
||||
|
||||
[ship.schematic]
|
||||
materials = [{item = "iron_ingot", amount = 4}, {item = "circuit_board", amount = 2}]
|
||||
player_production_level = 3
|
||||
production_time_seconds = 15
|
||||
|
||||
[ship.threat]
|
||||
cost_formula = "0"
|
||||
|
||||
[ship.health]
|
||||
hp_formula = "60 + 5*x"
|
||||
|
||||
[ship.movement]
|
||||
speed_formula = "130"
|
||||
|
||||
[ship.sensor]
|
||||
sensor_range_formula = "250"
|
||||
|
||||
[ship.repair]
|
||||
repair_rate_formula = "5 + x"
|
||||
repair_range_formula = "80"
|
||||
|
||||
[ship.loot]
|
||||
scrap_drop = 2
|
||||
@@ -1,30 +0,0 @@
|
||||
[hq]
|
||||
surface_mask = [
|
||||
"AAA",
|
||||
"AAA",
|
||||
"AAA",
|
||||
]
|
||||
hp_formula = "1000"
|
||||
|
||||
[player_station]
|
||||
surface_mask = [
|
||||
"SS",
|
||||
"SS",
|
||||
]
|
||||
level = 5
|
||||
hp_formula = "300 + 40*x"
|
||||
damage_formula = "5 + 4*x"
|
||||
range_formula = "300 + 20*x"
|
||||
fire_rate_formula = "0.5 + 0.2*x"
|
||||
scrap_drop_formula = "x"
|
||||
|
||||
[enemy_station]
|
||||
surface_mask = [
|
||||
"SS",
|
||||
"SS",
|
||||
]
|
||||
hp_formula = "300 + 150*x"
|
||||
damage_formula = "20 + 10*x"
|
||||
range_formula = "350 + 20*x"
|
||||
fire_rate_formula = "1.0 + 0.2*x"
|
||||
scrap_drop_formula = "10 + 5*x"
|
||||
@@ -1,29 +0,0 @@
|
||||
[world]
|
||||
height_tiles = 60
|
||||
refund_percentage = 75
|
||||
starting_building_blocks = 100
|
||||
scrap_despawn_seconds = 30
|
||||
belt_speed_tiles_per_second = 2
|
||||
tunnel_max_distance = 10
|
||||
departure_interval_seconds = 20
|
||||
|
||||
[regions]
|
||||
asteroid_width = 40
|
||||
player_buffer_width = 10
|
||||
contest_zone_width = 30
|
||||
enemy_buffer_width = 15
|
||||
|
||||
[expansion]
|
||||
columns_per_expansion = 10
|
||||
cost_building_blocks = 200
|
||||
|
||||
[push]
|
||||
push_expand_columns = 20
|
||||
scaling_factor = 1.2
|
||||
|
||||
[waves]
|
||||
threat_rate_formula = "1*x - 30"
|
||||
ship_level_formula = "1 + x / 120"
|
||||
gap_min_seconds = 15
|
||||
gap_max_seconds = 45
|
||||
spawn_duration_seconds = 10
|
||||
Reference in New Issue
Block a user