public void playTable()
        {
            int rounds = 0;

            foreach (Player.Player p in players)
            {
                p.bet = 0;
            }
            while (deal.markedForRemove.Count < players.Count - 1)
            {
                deal.play();
                //  MessageBox.Show("Kor vege!\n " + getHandValue(0) +"\n"+ getHandValue(1));
                deal.pay();
                removePlayers();
                nextState();
                resetFolds();
                movePos();
                rounds++;
                if (rounds == 5)
                {
                    rounds     = 0;
                    smallBlind = bigBlind;
                    bigBlind  *= 2;
                }
                controls.vizualize();
            }
            int tmpid = nextActiveId(0) + 1;

            MessageBox.Show("Winner is Player " + tmpid);
            controls.Invoke((Action) delegate
            {
                controls.newTable();
            });
        }
示例#2
0
        public void TestDivisionCards_IncInformationForm_Visualize()
        {
            bool result = true;
            IncInformationForm testForm = new IncInformationForm();

            testForm.table.resetTable();
            testForm.vizualize();
            if (testForm.Flop1.Image != testForm.table.flop[0].CardImage)
            {
                result = false;
            }
            if (testForm.Flop2.Image != testForm.table.flop[1].CardImage)
            {
                result = false;
            }
            if (testForm.Flop3.Image != testForm.table.flop[2].CardImage)
            {
                result = false;
            }
            if (testForm.River.Image != testForm.table.river.CardImage)
            {
                result = false;
            }
            if (testForm.Turn.Image != testForm.table.turn.CardImage)
            {
                result = false;
            }
            Assert.IsTrue(result);
        }
示例#3
0
        public void Test_PlayerCards_IncInformationForm_Visualize()
        {
            bool result = true;
            IncInformationForm testForm = new IncInformationForm();

            testForm.table.resetTable();
            testForm.vizualize();
            int i = 0;

            foreach (var p in testForm.table.players)
            {
                if (testForm.cardIterator[i].Image.Size != (p.cards[0].CardImage.Size))
                {
                    result = false;
                }
                if (testForm.cardIterator[i + 1].Image.Size != (p.cards[0].CardImage.Size))
                {
                    result = false;
                }
                i += 2;
            }
            Assert.IsTrue(result);
        }