diff --git a/python-api-src/lib_unittype.cpp b/python-api-src/lib_unittype.cpp index 66851b6d62a36bd3735a68878dcb8ec5a744dbaf..b8aa24de470d04b5de1f08b23bb28f18dace4b07 100644 --- a/python-api-src/lib_unittype.cpp +++ b/python-api-src/lib_unittype.cpp @@ -37,6 +37,8 @@ void define_unittype(py::module & m) .def_property_readonly("is_egg", &UnitType::isEgg) .def_property_readonly("is_queen", &UnitType::isQueen) .def_property_readonly("is_tank", &UnitType::isTank) + .def("__hash__", [](const UnitType & unit_type) { return std::hash<CCUnitID>{}(unit_type.getAPIUnitType()); }) + .def(py::self == py::self) .def("__repr__", [](const UnitType & unit_type) { return "<UnitType: '" + unit_type.getName() + "'>"; }); // Not implemented in CommandCenter