Implement city production projects for units and buildings

This commit is contained in:
bart
2026-11-08 21:22:04 +01:00
parent ae04619dae
commit f8cd221e37
19 changed files with 444 additions and 12 deletions
+7
View File
@@ -42,6 +42,13 @@ bool UnitConfigManager::loadConfigFile(const QString &filePath)
cfg.health = root.hasChild("health") ? root["health"].asInt(100) : 100;
cfg.movementSpeed = root.hasChild("movement_speed") ? root["movement_speed"].asFloat(2.0f) : 2.0f;
cfg.cost = root.hasChild("cost") ? root["cost"].asInt(20) : 20;
if (root.hasChild("labor_cost")) {
cfg.laborCost = root["labor_cost"].asInt(1000);
} else if (root.hasChild("production_cost")) {
cfg.laborCost = root["production_cost"].asInt(1000);
} else {
cfg.laborCost = cfg.cost * 20;
}
cfg.attackDamage = root.hasChild("attack_damage") ? root["attack_damage"].asInt(0) : 0;
cfg.attackRange = root.hasChild("attack_range") ? root["attack_range"].asInt(1) : 1;
cfg.buildCharges = root.hasChild("build_charges") ? root["build_charges"].asInt(-1) : -1;