c# declaring a variable as a parameter, novice question
<p>I've been working a week on teaching myself C# (with no C++ or Java), on a project of making an elaborate poker-hand parser. I'm finally caving in and posting my first simple question. </p>

<p>I think I've seen variable declarations in various ways (new to my VB/A experience). Here's the general idea of what I'd like to do. </p>

<pre><code>public class CompareHandsClass : IComparer&lt;clHiHand&gt;
</code></pre>

<p>...</p>

<pre><code>public class clCardsHeld
{   
    protected List&lt;clCard&gt; _liCards = new List&lt;clCard&gt;();

    public clCardsHeld(List&lt;clCard&gt; CardsList)
    {   _liCards = CardsList;
    }
</code></pre>

<p>...</p>

<pre><code>public class clHiHand : clCardsHeld
{
    public clHiHand(List&lt;clCard&gt; CardsList) : base(CardsList) {}

    List&lt;clCard&gt; _liTempCards;
    CompareHandsClass HandComparer = new CompareHandsClass(); 
    ...
    if (_liTempCards.Count &gt;= 5 
    &amp;&amp; HandComparer.Compare(clHiHand x = new clHiHand(_liTempCards), 
                            clHiHand y = new clHiHand(_liFlushCards))) 
</code></pre>

<p>So my problem is down at the end with HandComparer.Compare. I've got two Lists of my clCard type, but I can't send them to .Compare() because that takes clHiHand objects. So I'm trying to send the lists as arguments to constructors of temporary clHiHand type variables all at once. I can do this somehow can't I (aside from using several lines of declarations)? Thanks for any beginner's help (I'm kind of disappointed I get stumped on this little thing of all places...) </p>

<p>Oh and, PS, I hope I didn't mess up anything else in this sample code, since I've gotten away from my last working version with these extensions.</p>
