Im trying to add cards to a list. The cards are structs. In my struct I have a constructor that takes a value and a suit. When I try to create a new card, I get the error "'Blackjack.Program.Card' does not contain a constructor that takes 2 arguments" As you can see though, it does. This is my code.
public struct Card
{
int value;
string suit;
Card(int _value, string _suit)
{
value = _value;
suit = _suit;
}
};
public List<Card> deck = new List<Card>();
static void shuffleNewDeck(ref List<Card> newDeck)
{
newDeck.Clear();
for (int i = 0; i < 13; i++) // add spades
{
newDeck.Add(new Card(i, "Spade")); // error here
}
}