--- a/src/linetypes/object.h Tue Nov 02 15:43:57 2021 +0200 +++ b/src/linetypes/object.h Thu Mar 03 11:42:52 2022 +0200 @@ -86,6 +86,20 @@ virtual void setProperty(SetPropertyResult* result, const PropertyKeyValue& pair); }; +/** + * @brief Tests whether the object is exactly of the specified type + * @tparam R Type of LDraw line type object to test for + * @param object Object to test + * @returns whether the type of the object specified by @c id is the same type as R. Returns false if it is a subclass. + */ +template<typename R> +bool isA(const ldraw::Object* object) +{ + const std::type_info& a = typeid(*object); + const std::type_info& b = typeid(R); + return a == b; +} + template<ldraw::Property property> ldraw::Object::SetPropertyResult ldraw::Object::setProperty(const ldraw::PropertyType<property>& value) {