From ab7b1231aea074b4f1d28d5ecebfdb580aeef83a Mon Sep 17 00:00:00 2001
From: Rojikku98 <edvbe696@student.liu.se>
Date: Tue, 28 Jul 2020 15:30:04 +0200
Subject: [PATCH] ReplayUnit subclass of Unit

---
 python-api-src/lib_replay_unit.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/python-api-src/lib_replay_unit.cpp b/python-api-src/lib_replay_unit.cpp
index 63197f2..907fef4 100644
--- a/python-api-src/lib_replay_unit.cpp
+++ b/python-api-src/lib_replay_unit.cpp
@@ -2,6 +2,17 @@
 
 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)
 {
 	py::class_<ReplayUnit>(m, "ReplayUnit")
@@ -41,3 +52,4 @@ void define_replay_unit(py::module & m)
 		.def("__repr__", [](const ReplayUnit & unit) { return "<Unit of type: '" + unit.getTypeName() + "'>"; })
 		;
 }
+*/
\ No newline at end of file
-- 
GitLab