Skip to content
Snippets Groups Projects
Commit ab7b1231 authored by Edvin Bergström's avatar Edvin Bergström
Browse files

ReplayUnit subclass of Unit

parent 907971dd
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,17 @@ ...@@ -2,6 +2,17 @@
namespace py = pybind11; namespace py = pybind11;
void define_replay_unit(py::module & m)
{
py::class_<ReplayUnit, Unit>(m, "ReplayUnit")
.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("target", &ReplayUnit::getTarget)
.def_property_readonly("has_target", &ReplayUnit::hasTarget)
.def("__repr__", [](const ReplayUnit & unit) { return "<Unit of type: '" + unit.getTypeName() + "'>"; })
;
}
/*
void define_replay_unit(py::module & m) void define_replay_unit(py::module & m)
{ {
py::class_<ReplayUnit>(m, "ReplayUnit") py::class_<ReplayUnit>(m, "ReplayUnit")
...@@ -41,3 +52,4 @@ void define_replay_unit(py::module & m) ...@@ -41,3 +52,4 @@ void define_replay_unit(py::module & m)
.def("__repr__", [](const ReplayUnit & unit) { return "<Unit of type: '" + unit.getTypeName() + "'>"; }) .def("__repr__", [](const ReplayUnit & unit) { return "<Unit of type: '" + unit.getTypeName() + "'>"; })
; ;
} }
*/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment