Skip to content
Snippets Groups Projects
Commit 1b164fb7 authored by Sopi (sofab194)'s avatar Sopi (sofab194)
Browse files

fixed indents

fixed indents to match previously written code
parent 7a75dd33
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@ PYBIND11_MODULE(library, m)
.def_property_readonly("current_supply", &IDABot::GetCurrentSupply, "How much supply we are currently using")
.def_property_readonly("max_supply", &IDABot::GetMaxSupply, "How much supply we can currently use")
.def_property_readonly("gas", &IDABot::GetGas, "How much gas we currently have")
.def_property_readonly("current_frame", &IDABot::GetCurrentFrame, "Which frame we are currently on");
.def_property_readonly("current_frame", &IDABot::GetCurrentFrame, "Which frame we are currently on");
py::class_<sc2::PlayerSetup>(m, "PlayerSetup");
......
......@@ -300,42 +300,42 @@ bool Unit::isConstructing(const UnitType & type) const
Unit Unit::getTarget() const
{
BOT_ASSERT(isValid(), "Unit is not valid");
BOT_ASSERT(hasTarget(), "Unit has no target");
BOT_ASSERT(isValid(), "Unit is not valid");
BOT_ASSERT(hasTarget(), "Unit has no target");
//if unit has order, check tag of target of first order
if(getUnitPtr()->orders.size() > 0){
//t_id is set to the unit tag of the target
CCUnitID t_id = getUnitPtr()->orders[0].target_unit_tag;
//IDAbot finds the unit with this tag
return m_bot->GetUnit(t_id);
}
//if unit has order, check tag of target of first order
if(getUnitPtr()->orders.size() > 0){
//t_id is set to the unit tag of the target
CCUnitID t_id = getUnitPtr()->orders[0].target_unit_tag;
//IDAbot finds the unit with this tag
return m_bot->GetUnit(t_id);
}
Unit this_unit = Unit(m_unit, *m_bot);
return this_unit;
Unit this_unit = Unit(m_unit, *m_bot);
return this_unit;
}
bool Unit::hasTarget() const
{
BOT_ASSERT(isValid(), "Unit is not valid");
BOT_ASSERT(isValid(), "Unit is not valid");
if (getUnitPtr()->orders.size() > 0) {
if (getUnitPtr()->orders[0].target_unit_tag != NULL) {
CCUnitID t_id = getUnitPtr()->orders[0].target_unit_tag;
//IDAbot finds the unit with this tag, and returns true if valid
return m_bot->GetUnit(t_id).isValid();
}
}
if (getUnitPtr()->orders.size() > 0) {
if (getUnitPtr()->orders[0].target_unit_tag != NULL) {
CCUnitID t_id = getUnitPtr()->orders[0].target_unit_tag;
//IDAbot finds the unit with this tag, and returns true if valid
return m_bot->GetUnit(t_id).isValid();
}
}
return false;
return false;
}
bool Unit::isBlip() const
{
BOT_ASSERT(isValid(), "Unit is not valid");
BOT_ASSERT(isValid(), "Unit is not valid");
#ifdef SC2API
return m_unit->is_blip;
return m_unit->is_blip;
#else
return m_unit->isBlip();
return m_unit->isBlip();
#endif
}
......@@ -48,8 +48,8 @@ public:
bool isConstructing(const UnitType & type) const;
bool isBlip() const;
bool hasTarget() const;
Unit getTarget() const;
bool hasTarget() const;
Unit getTarget() const;
void stop () const;
void attackUnit (const Unit & target) const;
......
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