diff --git a/python-api-src/lib_base_location.cpp b/python-api-src/lib_base_location.cpp index 2a979b9816e8d603dd77cf230717ded3405169c5..303031103c2e5f3afc1fde990d49c7372d57bb34 100644 --- a/python-api-src/lib_base_location.cpp +++ b/python-api-src/lib_base_location.cpp @@ -19,7 +19,7 @@ void define_base_location(py::module & m) py::class_<BaseLocationManager>(m, "BaseLocationManager") .def_property_readonly("base_locations", &BaseLocationManager::getBaseLocations, py::return_value_policy::reference) .def_property_readonly("starting_base_locations", &BaseLocationManager::getStartingBaseLocations, py::return_value_policy::reference) - .def("get_occupied_base_locations", &BaseLocationManager::getOccupiedBaseLocations, py::return_value_policy::reference) - .def("get_player_starting_base_location", &BaseLocationManager::getPlayerStartingBaseLocation, py::return_value_policy::copy) - .def("get_next_expansion", &BaseLocationManager::getNextExpansion, py::return_value_policy::copy); + .def("get_occupied_base_locations", &BaseLocationManager::getOccupiedBaseLocations, py::return_value_policy::reference, "player_constant"_a) + .def("get_player_starting_base_location", &BaseLocationManager::getPlayerStartingBaseLocation, py::return_value_policy::copy, "player_constant"_a) + .def("get_next_expansion", &BaseLocationManager::getNextExpansion, py::return_value_policy::copy, "player_constant"_a); } \ No newline at end of file diff --git a/python-api-src/lib_map_tools.cpp b/python-api-src/lib_map_tools.cpp index daa00f26ff39f460c2a603b05fac74e2a42d043c..c89b19fd55f0c2ece328d33e964fa928a6a2fd5c 100644 --- a/python-api-src/lib_map_tools.cpp +++ b/python-api-src/lib_map_tools.cpp @@ -6,15 +6,15 @@ void define_map_tools(py::module & m) { const CCColor white{ 255, 255, 255 }; py::class_<MapTools>(m, "MapTools") - .def_property_readonly("width", &MapTools::width) - .def_property_readonly("height", &MapTools::height) + .def_property_readonly("width", &MapTools::width, "The width of the map") + .def_property_readonly("height", &MapTools::height, "The height of the map") //.def("terrainHeight", &MapTools::terrainHeight, py::const_) .def("draw_line", py::overload_cast<const CCPosition &, const CCPosition &, const CCColor &>(&MapTools::drawLine, py::const_), py::arg("start"), py::arg("stop"), py::arg("color")) //.def("draw_line", py::overload_cast<CCPositionType, CCPositionType, CCPositionType, CCPositionType, const CCColor &>(&MapTools::drawLine, py::const_)); // TODO: Default argument?? .def("draw_box", py::overload_cast<const CCPosition &, const CCPosition &, const CCColor &>(&MapTools::drawBox, py::const_), py::arg("top_left"), py::arg("bottom_right"), py::arg("color")) .def("draw_circle", py::overload_cast<const CCPosition &, CCPositionType, const CCColor &>(&MapTools::drawCircle, py::const_), py::arg("center"), py::arg("radius"), py::arg("color")) - .def("draw_text", &MapTools::drawText) - .def("draw_text_screen", &MapTools::drawTextScreen); + .def("draw_text", &MapTools::drawText, "position"_a, "text"_a, "color"_a) + .def("draw_text_screen", &MapTools::drawTextScreen, "percentage_x"_a, "percentage_y"_a, "text"_a, "color"_a); /* TODO: Left to implement diff --git a/python-api-src/lib_unit.cpp b/python-api-src/lib_unit.cpp index 11974bb9baad552db2557844fc4432d9cac741b7..22d1f3427db03c8034c57ccbec254592b35304da 100644 --- a/python-api-src/lib_unit.cpp +++ b/python-api-src/lib_unit.cpp @@ -5,9 +5,9 @@ namespace py = pybind11; void define_unit(py::module & m) { py::class_<Unit>(m, "Unit") - .def_property_readonly("unit_type", &Unit::getType) - .def_property_readonly("position", &Unit::getPosition) - .def_property_readonly("tile_position", &Unit::getTilePosition) + .def_property_readonly("unit_type", &Unit::getType, "The :class:`library.UnitType` of the unit") + .def_property_readonly("position", &Unit::getPosition, "The class:`library.Point2D` of the unit") + .def_property_readonly("tile_position", &Unit::getTilePosition, "The :class:`library.Point2DI` of the unit") .def_property_readonly("hit_points", &Unit::getHitPoints) .def_property_readonly("shields", &Unit::getShields) .def_property_readonly("energy", &Unit::getEnergy) diff --git a/python-api-src/library.cpp b/python-api-src/library.cpp index 1baf98a5b1e16d2328645f5530f02e4b3449f4e7..80cc71de91c0c9a1e2e97c43a6aaad4a2fb9c060 100644 --- a/python-api-src/library.cpp +++ b/python-api-src/library.cpp @@ -18,9 +18,9 @@ PYBIND11_MODULE(library, m) py::class_<Coordinator>(m, "Coordinator") .def(py::init()) - .def("set_participants", &sc2::Coordinator::SetParticipants) + .def("set_participants", &sc2::Coordinator::SetParticipants, "participants"_a) .def("launch_starcraft", &sc2::Coordinator::LaunchStarcraft) - .def("start_game", &sc2::Coordinator::StartGame) + .def("start_game", &sc2::Coordinator::StartGame, "map_path"_a) .def("update", &sc2::Coordinator::Update); py::enum_<sc2::Race>(m, "Race")