Skip to content
Snippets Groups Projects
Commit 1fc8bfaa authored by David Bergström's avatar David Bergström
Browse files

Merge branch 'master' into 'master'

Master

See merge request !4
parents 7fb62b83 0d81546d
Branches
Tags
No related merge requests found
...@@ -48,6 +48,7 @@ void TechTree::onStart() ...@@ -48,6 +48,7 @@ void TechTree::onStart()
data.requiredUnits.clear(); data.requiredUnits.clear();
data.requiredUpgrades.clear(); data.requiredUpgrades.clear();
updated.insert(description.result_type); updated.insert(description.result_type);
data.buildTime = description.buildTime; // The time in seconds it takes to create the unit
data.buildAbility = sc2::ABILITY_ID::INVALID; data.buildAbility = sc2::ABILITY_ID::INVALID;
} }
......
...@@ -116,6 +116,7 @@ void parse_build_description(BuildDescription & description, json & build_item) ...@@ -116,6 +116,7 @@ void parse_build_description(BuildDescription & description, json & build_item)
{ {
description.result_type = static_cast<sc2::UNIT_TYPEID>(build_item["unit"]); description.result_type = static_cast<sc2::UNIT_TYPEID>(build_item["unit"]);
description.build_ability = static_cast<sc2::ABILITY_ID>(build_item["ability"]); description.build_ability = static_cast<sc2::ABILITY_ID>(build_item["ability"]);
description.buildTime = static_cast<int>(build_item["time"]); // The time in seconds it takes to create the unit parsed from the json file
if (build_item.find("requires") != build_item.end()) if (build_item.find("requires") != build_item.end())
{ {
......
...@@ -18,6 +18,7 @@ struct BuildDescription ...@@ -18,6 +18,7 @@ struct BuildDescription
std::vector<sc2::UNIT_TYPEID> buildings_needed; std::vector<sc2::UNIT_TYPEID> buildings_needed;
std::vector<sc2::UNIT_TYPEID> addons_needed; std::vector<sc2::UNIT_TYPEID> addons_needed;
std::vector<sc2::UPGRADE_ID> upgrades_needed; std::vector<sc2::UPGRADE_ID> upgrades_needed;
int buildTime; // The time in seconds it takes to create the unit
}; };
struct ResearchDescription struct ResearchDescription
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment