diff --git a/docs/perception.rst b/docs/perception.rst index 7418c997f87a7274cefdfc302937758fffeeaa98..9bbbe07a3f4c16bea53c39ab6bd0ab343e650fe7 100644 --- a/docs/perception.rst +++ b/docs/perception.rst @@ -46,15 +46,29 @@ BaseLocation the BaseLocationManager to keep track of all base locations and related information. - .. attribute:: library.BaseLocation.position + .. attribute:: position The position of the center of the BaseLocation, defined as a :class:`library.Point2D`. - This is the position used if you want to build a Command Center at the - base location. - .. attribute:: library.BaseLocation.depot_position + .. attribute:: depot_position + + A suitable position for building a town hall (Command Center, Hatchery or + Nexus), defined as a :class:`library.Point2DI`. + + .. autoattribute:: mineral_fields + + .. autoattribute:: minerals + + .. autoattribute:: geysers + + .. automethod:: get_ground_distance + + .. automethod:: is_occupied_by_player + + .. automethod:: is_player_start_location + + .. automethod:: contains_position - A suitable position for building a town hall, defined as a :class:`library.Point2DI`. TechTree -------- diff --git a/python-api-src/lib_base_location.cpp b/python-api-src/lib_base_location.cpp index 39973fd5806395597395bf77c3a0921550c17557..6293a37aaed935eb80fcc79f426b474eb29f09e7 100644 --- a/python-api-src/lib_base_location.cpp +++ b/python-api-src/lib_base_location.cpp @@ -5,16 +5,16 @@ namespace py = pybind11; void define_base_location(py::module & m) { py::class_<BaseLocation>(m, "BaseLocation") - .def_property_readonly("geysers", &BaseLocation::getGeysers) - .def_property_readonly("minerals", &BaseLocation::getMinerals) + .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)") .def_property_readonly("mineral_fields", &BaseLocation::getMinerals, "Alias for minerals in order to differentiate from harvested minerals") - .def_property_readonly("is_start_location", &BaseLocation::isStartLocation) - .def_property_readonly("depot_position", &BaseLocation::getDepotPosition) + .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, "Point2DI position suitable for placing a town hall") .def_property_readonly("position", &BaseLocation::getPosition) .def("get_ground_distance", py::overload_cast<const CCPosition &>(&BaseLocation::getGroundDistance, py::const_)) .def("get_ground_distance", py::overload_cast<const CCTilePosition &>(&BaseLocation::getGroundDistance, py::const_)) - .def("is_occupied_by_player", &BaseLocation::isOccupiedByPlayer) - .def("is_player_start_location", &BaseLocation::isPlayerStartLocation) + .def("is_occupied_by_player", &BaseLocation::isOccupiedByPlayer, "player constant"_a) + .def("is_player_start_location", &BaseLocation::isPlayerStartLocation, "player_constant"_a) .def("contains_position", &BaseLocation::containsPosition); py::class_<BaseLocationManager>(m, "BaseLocationManager")