title: List of different types in C# (Inventory system)
body: <p>So, I'm building an inventory system in Unity3D using C# from scratch and I've faced the following problem:</p>
  
  <p>I have three types of inventory objects:</p>
  
  <p><strong>Weapons, Equipments and Consumables.</strong></p>
  
  <p>So, for example:</p>
  
  <pre><code>// Weapon Class
  class Weapon : Equipable
  {
      public int damage
  }
  
  // Equipment Class
  class Equipment : Equipable
  {
  
      public EquipmentType equipmentType;
  
      public enum EquipmentType {
          Helmet,
          Armor
      }
  }    
  
  // Consumable Class
  class Consumable : Item
  {
      public ConsumableStat stat;
      public int factor;
  
      public enum ConsumableStat
      {
          Life,
          Mana
      }
  }
  
  // Equipable Class
  class Equipable : Item
  {
      public int durability
  }
  
  // Item Class
  class Item
  {
      public string name;
  }
  </code></pre>
  
  <p>Now, player has a list as an inventory.</p>
  
  <p>This list, should store <strong>Weapons, Equipments and Consumables</strong></p>
  
  <p>I've tried:</p>
  
  <pre><code>public List&lt;T&gt; inventory
  </code></pre>
  
  <p>But I receive the following error on console:</p>
  
  <p><strong>The type or namespace name `T' could not be found. Are you missing a using directive or an assembly reference?</strong></p>
  
  <p>Have searched the internet but found solutions that I don't think it's the most correct way to deal with it.</p>
  
  <p>Someone already step in this issue?</p>
  
  <p>What's the best way to really create a list of Generic Objects?</p>
  
  <p>C# and Unity3D is new for me. I'm a experienced web developer migrating to gaming development.</p>
  
  <p>Ps.: Sorry for the poor English and thanks in advance!</p>