本文整理汇总了C#中IHand.TotalPoints方法的典型用法代码示例。如果您正苦于以下问题:C# IHand.TotalPoints方法的具体用法?C# IHand.TotalPoints怎么用?C# IHand.TotalPoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHand
的用法示例。
在下文中一共展示了IHand.TotalPoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpenWith13PlusNoNTOpening
/// <summary>
/// Opens the with13 plus.
/// </summary>
/// <param name="myHand">My hand.</param>
/// <returns></returns>
private PlacedBid OpenWith13PlusNoNTOpening(IHand myHand)
{
List<List<ICard>> lst = myHand.BySuite.Select(x => x.ToList()).ToList();
lst.Sort((x, y) => x.Count.CompareTo(y.Count));
int totalPoints = myHand.TotalPoints();
if (totalPoints > 21)
{
return new PlacedBid(new BidTrumph(TrumphSuite.Clubs, 2), new List<BidMeaning>()
{
new BidMeaning(22, 32, SuiteTells.NoTell)
});
}
if (lst[0].Count >= 7)
{
// No suite can match this one, bid it.
return new PlacedBid(new BidTrumph(lst[0][0].Color.ToTrumpSuite(), 1),
new List<BidMeaning>()
{
new BidMeaning(13, 21, new List<SuiteTells>() { new SuiteTells(lst[0][0].Color, 4, 11) })
});
}
// 5 or 6 in suite
if (lst[0].Count >= 5)
{
if (lst[1].Count == lst[0].Count)
{
// Equal amount of cards and 6+. Bid highest ranked bidding color.
if (lst[1][0].Color.ToTrumpSuite().CompareTo(lst[0][0].Color.ToTrumpSuite()) > 0)
{
return new PlacedBid(new BidTrumph(lst[1][0].Color.ToTrumpSuite(), 1),
new List<BidMeaning>() {
new BidMeaning(13, 21,
new List<SuiteTells>() {
new SuiteTells(lst[1][0].Color, 4, 11)
})
}
);
}
}
else
{
return new PlacedBid(new BidTrumph(lst[0][0].Color.ToTrumpSuite(), 1),
new List<BidMeaning>() {
new BidMeaning(13, 21,
new List<SuiteTells>() {
new SuiteTells(lst[0][0].Color, 4, 11)
})
}
);
}
}
if (lst[0].Count >= 4)
{
// Bid hearts if hearts or spades
// Bid hearts or spades if also having clubs or diamonds
// Bid best clubs or diamonds
}
throw new NotImplementedException("Not fully implemented.");
}