using System.Collections.Generic;
public class IventoryItem {
public IventoryItem(string type){
} else if(type == "life"){
Console.WriteLine ("Using potion");
} else if(type == "life"){
Console.WriteLine ("Got an extra life");
Console.WriteLine ("Powered up to next level");
public class HelloWorld {
public static void Main(string[] args) {
var items = new List<IventoryItem>();
items.Add(new IventoryItem("potion"));
items.Add(new IventoryItem("power"));
items.Add(new IventoryItem("life"));
for (int i = 0; i < 5; i++) {
int val = rnd.Next(0, items.Count);
Console.WriteLine ("Random item: " + items[val].GetName());