本文整理汇总了C#中CardCollection.OrderByDescending方法的典型用法代码示例。如果您正苦于以下问题:C# CardCollection.OrderByDescending方法的具体用法?C# CardCollection.OrderByDescending怎么用?C# CardCollection.OrderByDescending使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CardCollection
的用法示例。
在下文中一共展示了CardCollection.OrderByDescending方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetListOfWinning
public Queue<Card> GetListOfWinning(IList<Card> currentHand, CardSuit suit, Queue<Card> q)
{
var currentSuitCards = new CardCollection
{
new Card(suit, CardType.Nine),
new Card(suit, CardType.Jack),
new Card(suit, CardType.Queen),
new Card(suit, CardType.King),
new Card(suit, CardType.Ten),
new Card(suit, CardType.Ace),
};
var cards = this.playedCardsInCurrentContext.Where(x => x.Suit == suit).ToList();
foreach (var card in cards)
{
currentSuitCards.Remove(card);
}
currentSuitCards.OrderByDescending(x => x.GetValue()).ToList();
if (currentSuitCards.Count() > 0)
{
if (currentHand.Contains(currentSuitCards.ElementAt(0)))
{
q.Enqueue(currentSuitCards.First());
}
}
return q;
}