Skip to content
Snippets Groups Projects

Replays

Merged Edvin Bergström requested to merge edvbe696/pycommandcenter:master into master
All threads resolved!
13 files
+ 396
269
Compare changes
  • Side-by-side
  • Inline
Files
13
@@ -6,8 +6,7 @@ void define_replay_unit(py::module & m)
{
py::class_<ReplayUnit>(m, "ReplayUnit")
.def_property_readonly("id", &ReplayUnit::getID)
.def_property_readonly("unit_type", &ReplayUnit::getType, "The id of the type")
.def_property_readonly("unit_type_name", &ReplayUnit::getTypeName, "The name of the type")
.def_property_readonly("unit_type", &ReplayUnit::getType, "The :class :`library.UnitType` of the unit")
.def_property_readonly("position", &ReplayUnit::getPosition, "The :class:`library.Point2D` of the unit")
.def_property_readonly("tile_position", &ReplayUnit::getTilePosition, "The :class:`library.Point2DI` of the unit")
.def_property_readonly("hit_points", &ReplayUnit::getHitPoints)
@@ -38,6 +37,6 @@ void define_replay_unit(py::module & m)
.def_property_readonly("is_carrying_minerals", &ReplayUnit::isCarryingMinerals)
.def("__hash__", [](const ReplayUnit & unit) { return std::hash<const sc2::Unit *>{}(unit.getUnitPtr()); })
.def(py::self == py::self)
.def("__repr__", [](const ReplayUnit & unit) { return "<Unit of type: '" + unit.getTypeName() +" player: " + std::to_string(unit.getPlayer()) +">"; })
.def("__repr__", [](const ReplayUnit & unit) { return "<Unit of type: '" + unit.getType().getName() + "'>"; })
;
}
Loading