using System.Collections;
using System.Collections.Generic;
public int Weight { get; set; }
public string Class { get; set; }
public int Damage { get; set; }
public string Effect { get; set; }
public int IntRestr { get; set; }
public int StrRestr { get; set; }
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);