Beispiel #1
0
        /// <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.");
        }