In C #, I would like to create a common deck of cards. Turning me on, for example, Create a stack of cards, a queue in cards, or any other collection of cards? If this collection is derived from IEnumerable.
public class Deck<T> where T : IEnumerable
{
private T<ICard> __Cards;
public Deck() : this(52){}
public Deck(int cards)
{
__Cards = new T<Card>(cards);
}
}
Some other classes ... calling
Deck<List> _Deck = new Deck<List>();
I get the following error:
The type parameter 'T' cannot be used with type arguments
source
share