From 7f11f269b42cabdf8c3a86a3dc0cdf823c06241a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Bergstr=C3=B6m?= <davbe125@student.liu.se>
Date: Mon, 10 Sep 2018 16:12:01 +0200
Subject: [PATCH] Fix is_constructing method (which was thought to be a
 property)

---
 python-api-src/lib_unit.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python-api-src/lib_unit.cpp b/python-api-src/lib_unit.cpp
index b664020..58cd791 100644
--- a/python-api-src/lib_unit.cpp
+++ b/python-api-src/lib_unit.cpp
@@ -25,7 +25,6 @@ void define_unit(py::module & m)
         .def_property_readonly("is_burrowed", &Unit::isBurrowed)
         .def_property_readonly("is_valid", &Unit::isValid)
         .def_property_readonly("is_training", &Unit::isTraining)
-        .def_property_readonly("is_constructing", &Unit::isConstructing)
         .def("stop", &Unit::stop)
         .def("attack_unit", &Unit::attackUnit)
         .def("attack_move", &Unit::attackMove)
@@ -38,6 +37,7 @@ void define_unit(py::module & m)
         .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("is_constructing", &Unit::isConstructing, "unit_type"_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() + "'>"; });
-- 
GitLab