C#中Dictionary和list的结合问题!
Dictionary<int, List<Cards>> dicListCards = new Dictionary<int, List<Cards>>();
Cards cards = new Cards();
cards.name = "测试";
List<Cards> listCards = new List<Cards>();
listCards.Add(cards);
dicListCards.Add(1,listCards);
foreach (KeyValuePair<int, List<Cards>> keyvalue in dicListCards)
{
List<Cards> listcards = keyvalue.Value;
foreach(Cards card in listcards)
{
Console.WriteLine(card.name);
}
}