title: Select elements of certain type from list (c#)
body: <p>I have a list of "traps" in my main class. In the subclass "Flame" I want to delete certain elements from that list. The problem is, how do I select these elements? Trap does have other sublasses with different attributes.</p>
  
  <p>This is what I got so far (code simplified, from "Flame.cs"):</p>
  
  <pre><code>public override Boolean collide()
  {
      var flames = form1.traps.Where(trap =&gt; trap.ID == ID);
      foreach (Flame f in flames)
      {
          if (f.pos &gt; pos)
          {
              form1.traps.Remove(f);
          }
      }
      return true;
  }
  </code></pre>
  
  <p>I feel like I should know this, but atm I'm stuck :/</p>