title: Detecting collisions of enemies
body: <p>I need to detect the collisions of the same type of enemies in XNA.<br>
  If a collision is detected, I wanted the enemies to turn around and walk in the other direction.</p>
  
  <p>If i save all instances to a List how can I detect if different(But same) type of enemies collide?</p>
  
  <p>This is in C# XNA.</p>
  
  <p>EDIT: I have enemies that are in a class called "Enemy", all enemies in my game are created from this class, I need to be able to check if the enemies have collided.</p>
  
  <p>EDIT 2:</p>
  
  <p>Here is a code sample:</p>
  
  <pre><code>    // Fields.        
      private List&lt;Enemy&gt; enemies = new List&lt;Enemy&gt;();
  
      // Add our enemies when we need to.
      enemies.Add(new Enemy(this, position, spriteSet));
  
      // Here is it's update method.
      private void UpdateEnemies(GameTime gameTime)
      {
          foreach (Enemy enemy in enemies)
          {
              enemy.Update(gameTime);
  
              // This code works because it's comparing the player.
              if (enemy.BoundingRectangle.Intersects(Player.BoundingRectangle))
              {
                  OnPlayerKilled(enemy);
              }
              // This code is always ture because enemy is enemy I can't figure out how to solve this.
                              if (enemy.BoundingRectangle.Intersects(enemy.BoundingRectangle))
              {
                  // Make enemies turn... This if statement is the problem.
              }
          }
  </code></pre>