Skip to content
Snippets Groups Projects
Commit 06bd4ecb authored by Sopi Abaied's avatar Sopi Abaied :alien:
Browse files

Fixed spacing in code

parent b94cf0f6
No related branches found
Tags 1.2.2
No related merge requests found
......@@ -28,14 +28,14 @@ void define_unit(py::module & m)
.def_property_readonly("is_blip", &Unit::isBlip)
.def_property_readonly("target", &Unit::getTarget)
.def_property_readonly("has_target", &Unit::hasTarget)
.def_property_readonly("max_hit_points", &Unit::getMaxHitPoints)
.def_property_readonly("progress", &Unit::getProgress)
.def_property_readonly("ability_id", &Unit::getAbilityID, "The AbilityID of currently used ability")
.def_property_readonly("facing", &Unit::getFacing)
.def_property_readonly("radius", &Unit::getRadius)
.def("hold_position", &Unit::holdPosition)
.def("patrol", py::overload_cast<const CCPosition &>(&Unit::patrol, py::const_))
.def("stop_dance", &Unit::stopDance)
.def_property_readonly("max_hit_points", &Unit::getMaxHitPoints)
.def_property_readonly("progress", &Unit::getProgress)
.def_property_readonly("ability_id", &Unit::getAbilityID, "The AbilityID of currently used ability")
.def_property_readonly("facing", &Unit::getFacing)
.def_property_readonly("radius", &Unit::getRadius)
.def("hold_position", &Unit::holdPosition)
.def("patrol", py::overload_cast<const CCPosition &>(&Unit::patrol, py::const_))
.def("stop_dance", &Unit::stopDance)
.def("stop", &Unit::stop)
.def("attack_unit", &Unit::attackUnit)
.def("attack_move", &Unit::attackMove)
......
......@@ -10,9 +10,9 @@ void define_unittype(py::module & m)
.def_property_readonly("unit_typeid", [](UnitType & unit_type) { return static_cast<sc2::UNIT_TYPEID>(unit_type.getAPIUnitType()); })
.def_property_readonly("name", &UnitType::getName)
.def_property_readonly("race", &UnitType::getRace)
.def_property_readonly("movement_speed", &UnitType::getMovementSpeed)
.def_property_readonly("sight_range", &UnitType::getSightRange)
.def_property_readonly("tech_requirement", &UnitType::getTechRequirement)
.def_property_readonly("movement_speed", &UnitType::getMovementSpeed)
.def_property_readonly("sight_range", &UnitType::getSightRange)
.def_property_readonly("tech_requirement", &UnitType::getTechRequirement)
.def_property_readonly("is_valid", &UnitType::isValid)
.def_property_readonly("is_building", &UnitType::isBuilding)
.def_property_readonly("is_combat_unit", &UnitType::isCombatUnit, "The unit is not any of the following: worker, supply provider, building, larva, egg")
......
......@@ -343,21 +343,18 @@ bool Unit::isBlip() const
CCHealth Unit::getMaxHitPoints() const
{
BOT_ASSERT(isValid(), "Unit is not valid");
return m_unit->health_max;
}
float Unit::getFacing() const
{
BOT_ASSERT(isValid(), "Unit is not valid");
return m_unit->facing;
}
float Unit::getRadius() const
{
BOT_ASSERT(isValid(), "Unit is not valid");
return m_unit->radius;
}
......@@ -377,7 +374,7 @@ sc2::AbilityID Unit::getAbilityID() const
{
BOT_ASSERT(isValid(), "Unit is not valid");
//if unit has order, return progress of first order
//if unit has order, return AbilityID of first order
if (getUnitPtr()->orders.size() > 0) {
return getUnitPtr()->orders[0].ability_id;
}
......@@ -388,20 +385,17 @@ sc2::AbilityID Unit::getAbilityID() const
void Unit::holdPosition() const
{
BOT_ASSERT(isValid(), "Unit is not valid");
m_bot->Actions()->UnitCommand(m_unit, sc2::ABILITY_ID::HOLDPOSITION);
}
void Unit::patrol(const CCPosition & targetPosition) const
{
BOT_ASSERT(isValid(), "Unit is not valid");
m_bot->Actions()->UnitCommand(m_unit, sc2::ABILITY_ID::PATROL, targetPosition);
}
void Unit::stopDance() const
{
BOT_ASSERT(isValid(), "Unit is not valid");
m_bot->Actions()->UnitCommand(m_unit, sc2::ABILITY_ID::STOP_DANCE);
}
......@@ -50,14 +50,14 @@ public:
bool isBlip() const;
bool hasTarget() const;
Unit getTarget() const;
CCHealth getMaxHitPoints() const;
float getProgress() const;
sc2::AbilityID getAbilityID() const;
void holdPosition() const;
void patrol(const CCPosition & targetPosition) const;
void stopDance() const;
float getFacing() const;
float getRadius() const;
CCHealth getMaxHitPoints() const;
float getProgress() const;
sc2::AbilityID getAbilityID() const;
void holdPosition() const;
void patrol(const CCPosition & targetPosition) const;
void stopDance() const;
float getFacing() const;
float getRadius() const;
void stop () const;
void attackUnit (const Unit & target) const;
......
......@@ -383,7 +383,7 @@ int UnitType::getSightRange() const
return m_bot->Observation()->GetUnitTypeData()[m_type].sight_range;
}
UnitType UnitType::getTechRequirement() const
sc2::UnitTypeID UnitType::getTechRequirement() const
{
return m_bot->Observation()->GetUnitTypeData()[m_type].tech_requirement;
}
......@@ -23,9 +23,9 @@ public:
std::string getName() const;
CCRace getRace() const;
int getMovementSpeed() const;
int getSightRange() const;
UnitType getTechRequirement() const;
int getMovementSpeed() const;
int getSightRange() const;
sc2::UnitTypeID getTechRequirement() const;
bool isValid() const;
bool isBuilding() 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