If I do this it will ask if I'm missing a cast.
From reading on this forum it seems that a subclass is a type of the mainclass
but not the other way around.
To solve this I could make a method for each subclass of armor.
Instead of using (Armor armor) as a parameter, I would use the (HeadArmor headArmor), (ChestArmor chestArmor), etc...
But that seems tedious.
I also read that there is a difference between typeof() and is but I dont realy understand that either.
Preferably I would just cast the object armor to its subclass. Of course, the if function should check whether its not already the subclass (if that makes sense)
ps: There actualy are no instances of Armor objects. Only objects of subclasses are instantiated. (should it matter)
c# class casting type-conversion