private void DispType(Type type) { foreach(var item in inventory) { if (item is type) { //Do stuff } } }