This looks wrong.  If I make a blue bramble wall, can it stack on top of a regular bramble wall?  I think the answer is no, and so class equivalence is the wrong check.  You instead want to check whether either is in the class hierarchy of the other.  You can do this by calling IsClass twice (first check if A is a B, then if B is an A).  

Notice that you duplicate the exact same code a few lines below.  This is why code duplication is bad.  Make this into a helper function.