This method is called when the an unit is created, that includes when an unit leaves a refinery. This only works if replay perspective is not set to 0.
@@ -6,9 +6,9 @@ void define_base_location(py::module & m)
{
py::class_<BaseLocation>(m,"BaseLocation")
.def_property_readonly("geysers",&BaseLocation::getGeysers,"List of geysers at base location (List of units).")
.def_property_readonly("minerals",&BaseLocation::getMinerals,"List of mineral fields at base location (List of unit). Note: also returns the empty mineral fields.")
.def_property_readonly("is_start_location",&BaseLocation::isStartLocation,"True if the base location is a start location, False otherwise.")
.def_property_readonly("depot_position",&BaseLocation::getDepotPosition,"A suitable position for building a town hall (Command Center, Hatchery or Nexus), defined as a :class:`library.Point2DI`.")
.def_property_readonly("minerals",&BaseLocation::getMinerals,"List of mineral fields at base location (List of unit). Also returns the empty mineral fields.")
.def("is_start_location",&BaseLocation::isStartLocation,"True if the base location is a start location, False otherwise.")
.def_property_readonly("depot_position",&BaseLocation::getDepotPosition,"A suitable position for building a town hall (Command Center, Hatchery or Nexus), defined as a :class:`library.Point2DI`.")
.def_property_readonly("position",&BaseLocation::getPosition,"The position of the center of the BaseLocation, defined as a :class:`commandcenter.Point2D`.")
.def("get_ground_distance",py::overload_cast<constCCTilePosition&>(&BaseLocation::getGroundDistance,py::const_),"Returns the ground distance between the provided position and the base location. Note that this uses a BFS approach and may overshoot a bit.")
@@ -12,7 +12,7 @@ void define_unit(py::module & m)
.def_property_readonly("shields",&Unit::getShields,"Shield of the unit.")
.def_property_readonly("energy",&Unit::getEnergy,"Energy of the unit.")
.def_property_readonly("player",&Unit::getPlayer,"Returns the constant corresponding to player which this unit belongs to. See :ref:`playerconstants` for more information.")
.def_property_readonly("id",&Unit::getID,"Returns an int to identify the unit. Note This value does not stay the same for units you lose vision of, so maybe not best idea to use as a way of keeping track of them.")
.def_property_readonly("id",&Unit::getID,"Returns an int to identify the unit. This value does not stay the same for units you lose vision of, so maybe not best idea to use as a way of keeping track of them.")
.def_property_readonly("build_percentage",&Unit::getBuildPercentage,"Gives progress under construction. Range [0.0, 1.0]. 1.0 == finished.")
.def_property_readonly("weapon_cooldown",&Unit::getWeaponCooldown,"Time remaining for a weapon on cooldown.")
@@ -39,7 +39,7 @@ void define_unit(py::module & m)
.def_property_readonly("is_carrying_gas",&Unit::isCarryingGas,"Returns if this unit is currently holding gas.")
.def_property_readonly("gas_left_in_refinery",&Unit::gasLeftInGeyser,"Amount of vespene left in the the refinery.")
.def_property_readonly("minerals_left_in_mineralfield",&Unit::mineralsLeftInMineralfield,"Amount of minerals if the unit is a mineral field.")
.def_property_readonly("owner",&Unit::getOwner,"Which player owns a unit. Note: Not same as player; 'player' originates from IDA implementation whilst 'owner' originates from StarCraft II.")
.def_property_readonly("owner",&Unit::getOwner,"Which player owns a unit. Not same as player; 'player' originates from IDA implementation whilst 'owner' originates from StarCraft II.")
.def_property_readonly("max_shields",&Unit::maxShields,"Max shield of the unit.")
.def_property_readonly("max_energy",&Unit::maxEnergy,"Max energy of the unit.")