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

Correct some whitespace errors

parent 1fc8bfaa
No related branches found
No related tags found
No related merge requests found
...@@ -39,23 +39,17 @@ PYBIND11_MODULE(library, m) ...@@ -39,23 +39,17 @@ PYBIND11_MODULE(library, m)
m.attr("PLAYER_NEUTRAL") = py::int_((int) Players::Neutral); m.attr("PLAYER_NEUTRAL") = py::int_((int) Players::Neutral);
m.attr("PLAYER_ALLY") = py::int_((int) Players::Ally); m.attr("PLAYER_ALLY") = py::int_((int) Players::Ally);
/*
TODO: BuffID is not defined, defined as following by Blizzard:
typedef SC2Type<BUFF_ID> BuffID;
*/
py::class_<sc2::BuffID>(m, "BuffID") py::class_<sc2::BuffID>(m, "BuffID")
.def(py::init<sc2::BUFF_ID>()); .def(py::init<sc2::BUFF_ID>());
py::implicitly_convertible<sc2::BUFF_ID, sc2::BuffID>(); py::implicitly_convertible<sc2::BUFF_ID, sc2::BuffID>();
py::class_<sc2::UnitTypeID>(m, "UnitTypeID") py::class_<sc2::UnitTypeID>(m, "UnitTypeID")
.def(py::init<sc2::UNIT_TYPEID>()) .def(py::init<sc2::UNIT_TYPEID>())
.def("__eq__", [](const sc2::UnitTypeID &value, sc2::UNIT_TYPEID &value2) { return value == value2; }); .def("__eq__", [](const sc2::UnitTypeID &value, sc2::UNIT_TYPEID &value2) { return value == value2; });
py::implicitly_convertible<sc2::UNIT_TYPEID, sc2::UnitTypeID>(); py::implicitly_convertible<sc2::UNIT_TYPEID, sc2::UnitTypeID>();
py::class_<sc2::UpgradeID>(m, "UpgradeID") py::class_<sc2::UpgradeID>(m, "UpgradeID")
.def(py::init<sc2::UPGRADE_ID>()); .def(py::init<sc2::UPGRADE_ID>());
......
...@@ -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; // The time in seconds it takes to create the unit 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;
} }
...@@ -383,4 +383,4 @@ const TypeData & TechTree::getData(const MetaType & type) const ...@@ -383,4 +383,4 @@ const TypeData & TechTree::getData(const MetaType & type) const
BOT_ASSERT(false, "Can't getData this type: %s", type.getName().c_str()); BOT_ASSERT(false, "Can't getData this type: %s", type.getName().c_str());
return m_unitTypeData.begin()->second; return m_unitTypeData.begin()->second;
} }
\ No newline at end of file
...@@ -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"]); // The time in seconds it takes to create the unit parsed from the json file 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; // The time in seconds it takes to create the unit int buildTime; // The time in seconds it takes to create the unit
}; };
struct ResearchDescription struct ResearchDescription
...@@ -53,4 +53,4 @@ public: ...@@ -53,4 +53,4 @@ public:
const std::vector<BuildDescription> & BuildDescriptions() const { return build_descriptions; } const std::vector<BuildDescription> & BuildDescriptions() const { return build_descriptions; }
const std::vector<ResearchDescription> & ResearchDescriptions() const { return research_descriptions; } const std::vector<ResearchDescription> & ResearchDescriptions() const { return research_descriptions; }
}; };
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment