title: How to pass an arbitrary number of parameters in C#
body: <p>OK I need to design a way to keep track of how many of each item exists.
  There are approximately 26 items. I also need a way to find out if a certain combination of items exist.</p>
  
  <p>For example, 
  This is an engine for a card game. Each card has a different type and each card can have card attached to it.
  There need to be a certain combination of cards attached to a card for the player to do certain things in the game.
  To make this program streamlined, I would like to do something like</p>
  
  <pre><code>if (meetsCrit(2, water, 4, ground))
  {
      do this()
  }
  else
  {
      displayerror()
  }
  </code></pre>
  
  <p><strong>EDIT:</strong> SOLVED!</p>
  
  <p>I used a combination of techniques described in a few post below.
  Special mention to:</p>
  
  <p>Jon Skeet,
  Rinat Abdullin,
  Frank,</p>
  
  <p>Anyway here is what I did
  I made a class called pair which stores the type I'm looking for, and the number of that type.
  Then I used a Predicate Delegate to find all of that type and count how many there are,
  Then I compared it to number I was searching for and returned true or false respectively.</p>
  
  <p>This is the code for it</p>
  
  <pre><code>public bool meetsCrit(params Pair[] specs)
  {
      foreach (Pair i in specs)
      {
          if (!(attached.FindAll(delegate(Card c) { return c.type == i.type; }).Count &gt;= i.value))
          {
              return false;
          }
  
      }
      return true;
  }
  </code></pre>