Skip to content
Snippets Groups Projects
Commit 0d81546d authored by Stefan Brynielsson's avatar Stefan Brynielsson
Browse files

Implemented buildTime to TechTree, the build time is in seconds. The implementation has been tested

parent 0bc644d7
No related branches found
No related tags found
1 merge request!4Master
...@@ -48,7 +48,7 @@ void TechTree::onStart() ...@@ -48,7 +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; 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,7 +116,7 @@ void parse_build_description(BuildDescription & description, json & build_item) ...@@ -116,7 +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"]); 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,7 +18,7 @@ struct BuildDescription ...@@ -18,7 +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; 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.
Finish editing this message first!
Please register or to comment