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

Add hash and compare methods to UnitType class

parent d6d0e725
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment