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

Add more docstrings for unit class

parent 2c2c0d5e
No related branches found
No related tags found
No related merge requests found
......@@ -31,13 +31,13 @@ void define_unit(py::module & m)
.def("attack_move", &Unit::attackMove)
.def("move", py::overload_cast<const CCPosition &>(&Unit::move, py::const_))
.def("move", py::overload_cast<const CCTilePosition &>(&Unit::move, py::const_))
.def("right_click", &Unit::rightClick)
.def("right_click", &Unit::rightClick, "Same as right-clicking in the game, for example making workers mine minerals")
.def("repair", &Unit::repair)
.def("build", &Unit::build, "building_type"_a, "position"_a)
.def("build_target", &Unit::buildTarget)
.def("train", &Unit::train)
.def("morph", &Unit::morph)
.def("research", &Unit::research)
.def("build", &Unit::build, "Build unit of type building_type at given position", "building_type"_a, "position"_a)
.def("build_target", &Unit::buildTarget, "Build building_type on top of target Unit, useful for building refineries", "building_type"_a, "target"_a)
.def("train", &Unit::train, "Train unit of type", "unit_type"_a)
.def("morph", &Unit::morph, "Morph into type of unit_type", "unit_type"_a)
.def("research", &Unit::research, "Research the given :class:`library.UPGRADE_ID`", "upgrade_id"_a)
.def("__hash__", [](const Unit & unit) { return std::hash<const sc2::Unit *>{}(unit.getUnitPtr()); })
.def(py::self == py::self)
.def("__repr__", [](const Unit & unit) { return "<Unit of type: '" + unit.getType().getName() + "'>"; });
......
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