int goldValue { get; set;}
int durability {get; set;}
void TakeDamage (int _amount);
class Sword : IItem, IDamagable, IPartOfQuest
public string name {get; set;}
public int goldValue {get; set;}
public int durability { get; set; }
public Sword (string _name)
Console.WriteLine(name + " equiped");
Console.WriteLine(name + " sold for " + goldValue + " imaginary dollars.");
public void TakeDamage (int _dmg)
Console.WriteLine(name + "damaged by " + _dmg + ". It now has a durability of " + durability);
Console.WriteLine(name + " turned in.");
class Axe : IItem, IDamagable
public string name {get; set;}
public int goldValue {get; set;}
public int durability { get; set; }
public Axe (string _name)
Console.WriteLine(name + " equiped");
Console.WriteLine(name + " sold for " + goldValue + " imaginary dollars.");
public void TakeDamage (int _dmg)
Console.WriteLine(name + "damaged by " + _dmg + ". It now has a durability of " + durability);
public static void Main()
Sword sword = new Sword("Sword of Destiny");
Axe axe = new Axe ("Furry Axe");
IItem[] inventory = new IItem[2];
for (int i = 0; i < inventory.Length; i++)
IPartOfQuest questItem = inventory[i] as IPartOfQuest;