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

Add more docstrings to Color and IDABot

parent 27ebb1bf
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
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