Skip to content
Snippets Groups Projects
Commit 3e7e3868 authored by David Bergström's avatar David Bergström
Browse files

Update documentation on BaseLocation

parent 06b2f3e2
No related branches found
No related tags found
No related merge requests found
......@@ -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
--------
......
......@@ -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")
......
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