Beispiel #1
0
        private void AddChips()
        {
            AddChips chipAdder = new AddChips();
            chipAdder.ShowDialog();
            if (chipAdder.ChipsAmount > 0)
            {
                this.human.Chips = chipAdder.ChipsAmount;

                foreach (var bot in this.bots)
                {
                    bot.Chips += chipAdder.ChipsAmount;
                }

                this.human.OutOfChips = false;
                this.human.CanMakeTurn = true;
                this.buttonRaise.Enabled = true;
                this.buttonFold.Enabled = true;
                this.buttonCheck.Enabled = true;
                this.buttonRaise.Text = "Raise";
            }
        }
Beispiel #2
0
        private async Task Finish(int n)
        {
            if (n == 2)
            {
                this.FixWinners();
            }

            this.neededChipsToCall = this.bigBlindValue;
            this.raise = 0;
            this.foldedBotsCount = 5;
            this.type = 0;
            this.rounds = 0;
            this.raise = 0;
            this.restart = false;
            this.raising = false;
            this.height = 0;
            this.width = 0;
            this.winners = 0;
            this.maxLeft = 6;
            this.last = 123;
            this.raisedTurn = 1;
            this.pokerDatabase.PlayersGameStatus.Clear();
            this.pokerDatabase.CheckWinners.Clear();
            this.pokerDatabase.Chips.Clear();
            this.pokerDatabase.Winners.Clear();
            this.sorted.Current = 0;
            this.sorted.Power = 0;
            this.potStatus.Text = "0";
            this.secondsToMakeTurn = 60;
            this.up = 10000000;
            this.turnCount = 0;

            this.human.Panel.Visible = false;
            this.human.HandPower = 0;
            this.human.HandType = -1;
            this.human.Folded = false;
            this.human.OutOfChips = false;
            this.human.CanMakeTurn = true;
            this.human.Call = 0;
            this.human.Raise = 0;
            this.humanStatus.Text = string.Empty;

            for (int botCount = 0; botCount < this.bots.Count; botCount++)
            {
                this.bots[botCount].Panel.Visible = false;
                this.bots[botCount].HandPower = 0;
                this.bots[botCount].HandType = -1;
                this.bots[botCount].CanMakeTurn = false;
                this.bots[botCount].OutOfChips = false;
                this.bots[botCount].Folded = false;
                this.bots[botCount].Call = 0;
                this.bots[botCount].Raise = 0;
                this.bots[botCount].Status.Text = string.Empty;
            }

            if (this.human.Chips <= 0)
            {
                AddChips chipAdder = new AddChips();
                chipAdder.ShowDialog();
                if (chipAdder.ChipsAmount > 0)
                {
                    this.human.Chips = chipAdder.ChipsAmount;

                    foreach (var bot in this.bots)
                    {
                        bot.Chips += chipAdder.ChipsAmount;
                    }

                    this.human.OutOfChips = false;
                    this.human.CanMakeTurn = true;
                    this.buttonRaise.Enabled = true;
                    this.buttonFold.Enabled = true;
                    this.buttonCheck.Enabled = true;
                    this.buttonRaise.Text = "Raise";
                }
            }

            this.cardsImageLocation = Directory.GetFiles("..\\..\\Resources\\Assets\\Cards", "*.png", SearchOption.TopDirectoryOnly);
            for (int os = 0; os < 17; os++)
            {
                this.cardsPictureBoxList[os].Image = null;
                this.cardsPictureBoxList[os].Invalidate();
                this.cardsPictureBoxList[os].Visible = false;
            }

            await this.Shuffle();

            //await Turns();
        }