示例#1
0
        private void DealCardsForBots(
            IBot bot,
            int cardNumberIndex,
            Bitmap backImage,
            ref bool check,
            ref int horizontal,
            ref int vertical)
        {
            if (bot.Chips > 0)
            {
                this.foldedBotsCount--;
                if (cardNumberIndex >= bot.StartCard && cardNumberIndex < bot.StartCard + 2)
                {
                    if (this.cardsPictureBoxList[bot.StartCard].Tag != null)
                    {
                        this.cardsPictureBoxList[bot.StartCard + 1].Tag = this.reservedGameCardsIndeces[bot.StartCard + 1];
                    }

                    this.cardsPictureBoxList[bot.StartCard].Tag = this.reservedGameCardsIndeces[bot.StartCard];
                    if (!check)
                    {
                        horizontal = bot.HorizontalLocationCoordinate;
                        vertical = bot.VerticalLocationCoordinate;
                    }

                    check = true;
                    this.cardsPictureBoxList[cardNumberIndex].Anchor = bot.GetAnchorStyles();
                    this.cardsPictureBoxList[cardNumberIndex].Image = backImage;

                    //cardsPictureBoxList[i].Image = deckImages[i];
                    this.cardsPictureBoxList[cardNumberIndex].Location = new Point(horizontal, vertical);
                    horizontal += this.cardsPictureBoxList[cardNumberIndex].Width;
                    this.cardsPictureBoxList[cardNumberIndex].Visible = true;
                    this.Controls.Add(bot.Panel);
                    bot.InitializePanel(new Point(
                        this.cardsPictureBoxList[bot.StartCard].Left - 10,
                        this.cardsPictureBoxList[bot.StartCard].Top - 10));

                    if (cardNumberIndex == bot.StartCard + 1)
                    {
                        check = false;
                    }
                }
            }
        }