Exemplo n.º 1
0
        Boolean inCurrentHand; //

        public Seat(TablePlayer player)
        {
            this.player        = player;
            this.steppedAway   = false;
            this.unresponsive  = false;
            this.inCurrentHand = false;
        }
Exemplo n.º 2
0
 public void AddPlayer(TablePlayer player)
 {
     for (int i = 0; i < seats.Length; i++)
     {
         Seat seat = seats[i];
         if (seat == null)
         {
             seats[i] = new Seat(player);
             playerCountAtTheTable++;
             return;
         }
     }
     throw new InvalidOperationException("No seats left");
 }
 public void PrintStatus()
 {
     for (int i = 0; i < table.playerCountInCurrentHand; i++)
     {
         TablePlayer player = table.playersInCurrentHand[i];
         Console.WriteLine("Player {0,2} '{1,20}' {2,13} {3,13}", i, player.userName,
             player.highRankCard.CardName(), player.lowRankCard.CardName());
     }
     Console.WriteLine("Board: {0} {1} {2} {3} {4}",
         board1.CardName(),
         board2.CardName(),
         board3.CardName(),
         board4.CardName(),
         board5.CardName());
 }
        public void Hand()
        {
            table.NewHand();

            if(table.playerCountAtTheTable < 1)
            {
                // Can't play with less than 2 players at the table
                return;
            }

            if(table.playerCountInCurrentHand < 1)
            {
                // can't play with no players in the hand
                return;
            }

            //
            // Get the blinds
            //






            deck.Shuffle();

            //
            // Deal
            //
            Int32 deckIndex = 0;
            for (int i = 0; i < table.playerCountInCurrentHand; i++)
            {
                TablePlayer player = table.playersInCurrentHand[i];
                player.SetHoleCards(deck.cards[deckIndex], deck.cards[deckIndex + 1]);
                deckIndex += 2;
            }
            this.board1 = deck.cards[deckIndex++];
            this.board2 = deck.cards[deckIndex++];
            this.board3 = deck.cards[deckIndex++];
            this.board4 = deck.cards[deckIndex++];
            this.board5 = deck.cards[deckIndex++];

            //
            // Get Blinds
            //
            if(table.playerCountInCurrentHand < 2)
        }