From 083c398afb9e8ff9b520888a4ca8e660ddecd38d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Bergstr=C3=B6m?= <davbe125@student.liu.se>
Date: Fri, 3 Aug 2018 13:27:20 +0200
Subject: [PATCH] Add more docstrings to Color and IDABot

---
 python-api-src/library.cpp | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/python-api-src/library.cpp b/python-api-src/library.cpp
index 88cbd87f7..05cf271cc 100644
--- a/python-api-src/library.cpp
+++ b/python-api-src/library.cpp
@@ -62,18 +62,18 @@ PYBIND11_MODULE(library, m)
         .def(py::init())
         .def("on_game_start", &IDABot::OnGameStart)
         .def("on_step", &IDABot::OnStep)
-        .def("get_all_units", &IDABot::GetAllUnits)
-        .def("get_my_units", &IDABot::GetMyUnits)
+        .def("get_all_units", &IDABot::GetAllUnits, "Returns a list of all units")
+        .def("get_my_units", &IDABot::GetMyUnits, "Returns a list of all units beloning to the player")
         .def("get_player_race", &IDABot::GetPlayerRace)
         .def_property_readonly("base_location_manager", &IDABot::Bases)
         .def_property_readonly("tech_tree", &IDABot::GetTechTree)
         .def_property_readonly("map_tools", &IDABot::Map)
         .def_property_readonly("building_placer", &IDABot::GetBuildingPlacer)
-        .def_property_readonly("start_location", &IDABot::GetStartLocation)
-        .def_property_readonly("minerals", &IDABot::GetMinerals)
-        .def_property_readonly("current_supply", &IDABot::GetCurrentSupply)
-        .def_property_readonly("max_supply", &IDABot::GetMaxSupply)
-        .def_property_readonly("gas", &IDABot::GetGas);
+        .def_property_readonly("start_location", &IDABot::GetStartLocation, "CCPosition representing the start location")
+        .def_property_readonly("minerals", &IDABot::GetMinerals, "How much minerals we currently have")
+        .def_property_readonly("current_supply", &IDABot::GetCurrentSupply, "How much supply we are currently using")
+        .def_property_readonly("max_supply", &IDABot::GetMaxSupply, "How much supply we can currently use")
+        .def_property_readonly("gas", &IDABot::GetGas, "How much gas we currently have");
 
     py::class_<sc2::PlayerSetup>(m, "PlayerSetup");
 
@@ -92,9 +92,9 @@ PYBIND11_MODULE(library, m)
     py::class_<sc2::Color> color(m, "Color");
     color.def(py::init<>());
     color.def(py::init<int, int, int>(), "r"_a, "g"_a, "b"_a);
-    color.def_readwrite("r", &sc2::Color::r);
-    color.def_readwrite("g", &sc2::Color::g);
-    color.def_readwrite("b", &sc2::Color::b);
+    color.def_readwrite("r", &sc2::Color::r, "Red");
+    color.def_readwrite("g", &sc2::Color::g, "Green");
+    color.def_readwrite("b", &sc2::Color::b, "Blue");
     color.attr("WHITE") = sc2::Colors::White;
     color.attr("RED") = sc2::Colors::Red;
     color.attr("GREEN") = sc2::Colors::Green;
-- 
GitLab