示例#1
0
        public override Bid? RequestBid()
        {
            //BUG BUG BUG..... where do you clean this (FGS) for the second round?!?!?! will always have the value of last bid!!!  BUG BUG BUG
            //if (m_highestBid == -1)
            //{
                m_highestBid = Math.Round(GetHighestBid(this.Cards));
                m_highestBidSuit = GetHighestBidSuit();
            //}

            // bid is ICompareable !! this means you can sort by simply the bid rather than implement comparing
                Bid? currHighestBidObj = (from b in this.CurrentRoundStatus.Biddings
                                          where b != null
                                          orderby b.Value descending
                                          select b.Value).FirstOrDefault();

                Bid myHighestBid = new Bid { Amount = (int)m_highestBid, Suit = m_highestBidSuit };

            // each bidding round the minimum grows by one : 5 , 6 , 7
            if (myHighestBid.Amount >= (5 + this.CurrentRoundStatus.TurnNumber))
            {
                // if there is no heighest bid or my bid is heigher than the highest one
                if( !currHighestBidObj.HasValue || myHighestBid > currHighestBidObj.Value)
                {
                    return myHighestBid;
                }
            }

            return null;
        }
示例#2
0
 public RecieveBidEventArgs(Bid? bid)
     : base()
 {
     this.Bid = bid;
 }
 public void InvokeGetBidCompleted(Bid? b)
 {
     ResponseRecieved();
     if (OnGetBidCompleted != null)
         OnGetBidCompleted(this, new RecieveBidEventArgs(b));
 }
示例#4
0
        /// <summary>
        /// Initializes gameplay private members
        /// </summary>
        private void InitializeGame()
        {
            _selfDeclaration = CurrentRoundStatus.GetBid(PlayerSeat.Self).Value;

            int totalTricksBid = 0;
            for (int i = 0; i < 4; i++)
            {
                totalTricksBid += CurrentRoundStatus.GetBid((PlayerSeat)i).Value.Amount;
            }

            if (totalTricksBid < 13)
            {
                _underGame = true;
            }

            else
            {
                _underGame = false;
            }
        }
示例#5
0
 private string GetBiddingText(bool isBidding, Bid? bid)
 {
     return isBidding ? bid + "" : ( bid.HasValue ? bid.Value.Amount + "" : "");
 }