Skip to content
Snippets Groups Projects
Commit 46b7b2d6 authored by Dawid Lukasz Abucewicz's avatar Dawid Lukasz Abucewicz
Browse files

refactor: change some files needed for merge request

parent 8e532ee6
No related branches found
Tags 1.2.2
1 merge request!5feat: add is_carrying_minerals field for Unit class
......@@ -73,6 +73,9 @@ Unit
.. autoattribute:: tile_position
.. autoattribute:: unit_type
.. autoattribute:: weapon_cooldown
.. autoattribute:: is_carrying_minerals
Returns if this unit is currently holding minerals
.. attribute:: Unit.target
......
......@@ -34,7 +34,7 @@ void define_unit(py::module & m)
.def_property_readonly("current_ability_id", &Unit::getCurrentAbilityID, "The AbilityID of currently used ability")
.def_property_readonly("facing", &Unit::getFacing)
.def_property_readonly("radius", &Unit::getRadius)
.def_property_readonly("is_carrying_minerals", &Unit::isCarryingMinerals)
.def_property_readonly("is_carrying_minerals", &Unit::isCarryingMinerals)
.def("hold_position", &Unit::holdPosition)
.def("patrol", py::overload_cast<const CCPosition &>(&Unit::patrol, py::const_))
.def("stop_dance", &Unit::stopDance)
......
......@@ -428,14 +428,14 @@ void Unit::stopDance() const
bool Unit::isCarryingMinerals() const
{
BOT_ASSERT(isValid(), "Unit is not valid");
std::vector<CCBuff> buffs = m_unit->buffs;
for (auto & b : buffs)
{
if (b.to_string() == "271" or b.to_string() == "272")
{
return true;
}
}
return false;
BOT_ASSERT(isValid(), "Unit is not valid");
std::vector<CCBuff> buffs = m_unit->buffs;
for (auto & b : buffs)
{
if (b.to_string() == "271" or b.to_string() == "272")
{
return true;
}
}
return false;
}
......@@ -47,7 +47,7 @@ public:
bool isValid() const;
bool isTraining() const;
bool isConstructing(const UnitType & type) const;
bool isCarryingMinerals() const;
bool isCarryingMinerals() const;
bool isBlip() const;
bool hasTarget() 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