Checking Item class

I arranged full equipment so you can put on the chest armor, helmet and other things. All items are stored as Items (thats main class), and there are also classes which inherit from Items (Weapon, Armor, Jewelry). Now in Weapon, Armor and Jewelry class i defined enums with types of following items, so for example theres Dagger, Sword and Axe in Weapons, Helmet, Chest and Gloves in Armors. Now when I equip weapon I’d like to check if the Item() (because inventory is storing everything as Item()) is actually a Weapon() or Armor(). And how after that I can access variables from those classes?

I had another enum in Item class, so I could do that without troubles, but I don’t think its correct way to do it. If there’s another way, please let me know.

Never mind. I found that I can access those variables by typing ((Weapon)inventory[cnt])((Armor)inventory[cnt]) etc. Thanks anyways :]