.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace It_sSomething
{
    class Item
    {
        public int Weight { get; set; }
    }
    class Weapon : Item
    {
        public string Class { get; set; }
        public int Damage { get; set; }
    }
    class UsableItem : Item
    {
        public string Effect { get; set; }
    }
    class Staff : Weapon
    {
        public int IntRestr { get; set; }
    }
    class Sword : Weapon
    {
        public int StrRestr { get; set; }
    }
    public class Program
    {
        public static void Main(string[] args)
        {
            List<Item> inventory = new List<Item>();
            inventory.Add(new UsableItem() { Weight = 1, Effect = "Stun" });
            inventory.Add(new UsableItem() { Weight = 1, Effect = "Heal" });
            inventory.Add(new Staff() { Class = "Mage", Damage = 25, IntRestr = 10, Weight = 3 });
            inventory.Add(new Sword() { Class = "Warrior", Damage = 40, StrRestr = 10, Weight = 4 });
            inventory.Add(new Sword() { Class = "Warrior", Damage = 55, StrRestr = 15, Weight = 5 });
            inventory.Add(new Sword() { Class = "Warrior", Damage = 35, StrRestr = 5, Weight = 2 });
            inventory.Add(new Staff() { Class = "Mage", Damage = 30, IntRestr = 12, Weight = 2 });

            foreach (UsableItem i in inventory.OfType<UsableItem>())
                Console.WriteLine("Effect: {0} Weitght: {1}", i.Effect, i.Weight);
            foreach (Staff i in inventory.OfType<Staff>())
                Console.WriteLine("Class: {0} Damage: {1} Intelligence Restriction: {2} Weitght: {3}", i.Class, i.Damage, i.IntRestr, i.Weight);
            foreach (Sword i in inventory.OfType<Sword>())
                Console.WriteLine("Class: {0} Damage: {1} Strength Restriction: {2} Weitght: {3}", i.Class, i.Damage, i.StrRestr, i.Weight);
        }
    }
}
;