/// Checks if the two objects are of the same variant.
Checks if the two objects are of the same variant.
Checks if the two objects are of the same variant .
fn is_same_type(first: &Object, other: &Object) -> bool {
    if let Type::You(_) = first.obj_type {
        if let Type::You(_) = other.obj_type {
            true
        }
        else {
            false
        }
    }
    else if let Type::You2(_) = first.obj_type {
        if let Type::You2(_) = other.obj_type {
            true
        }
        else {
            false
        }
    }
    else if let Type::Group(_) = first.obj_type {
        if let Type::Group(_) = other.obj_type {
            true
        }
        else {
            false
        }
    }
    else if let Type::Level(_) = first.obj_type {
        if let Type::Level(_) = other.obj_type {
            true
        }
        else {
            false
        }
    }
    else if let Type::Image(_) = first.obj_type {
        if let Type::Image(_) = other.obj_type {
            true
        }
        else {
            false
        }
    }
    else if let Type::ImageInstance(img) = &first.obj_type {
        if let Type::ImageInstance(other_img) = &other.obj_type {
            img.class == other_img.class
        }
        else {
            false
        }
    }
    else {
        false
    }
}
fn is_same_type ( first : & Object , other : & Object ) -> bool { if let Type :: You ( _ ) = first . obj_type { if let Type :: You ( _ ) = other . obj_type { true } else { false } } else if let Type :: You2 ( _ ) = first . obj_type { if let Type :: You2 ( _ ) = other . obj_type { true } else { false } } else if let Type :: Group ( _ ) = first . obj_type { if let Type :: Group ( _ ) = other . obj_type { true } else { false } } else if let Type :: Level ( _ ) = first . obj_type { if let Type :: Level ( _ ) = other . obj_type { true } else { false } } else if let Type :: Image ( _ ) = first . obj_type { if let Type :: Image ( _ ) = other . obj_type { true } else { false } } else if let Type :: ImageInstance ( img ) = & first . obj_type { if let Type :: ImageInstance ( other_img ) = & other . obj_type { img . class == other_img . class } else { false } } else { false } }
Checks if the two objects are of the same variant.
Checks if the two objects are of the same variant .
first
&Object
other
&Object