Exemplo n.º 1
0
        public void getFlop()
        {
            Label RobotCombo = Control.Find("label9", true).FirstOrDefault() as Label;

            RobotCombo.Visible = false;
            DrawCards.VisibleCards();
            ShuffleCards();
            getHand();

            // for player & PC  3 4 5
            for (int i = 2; i < 5; i++)
            {
                playerHand[i] = getDeck[i + 2];//
                pcHand[i]     = new Card {
                    MySuit = getDeck[i + 2].MySuit, MyValue = getDeck[i + 2].MyValue, count = 0
                };
                Dilir[i - 2] = new Card {
                    MySuit = getDeck[i + 2].MySuit, MyValue = getDeck[i + 2].MyValue, count = 0
                };;                                                                                                        //  1 2 3
            }
            displayCardsPlayers();
            for (int i = 5; i < 8; i++)
            {
                DrawCards.DrawCardSuitValue(Dilir[i - 5], i, this);  // 1 2 3
            }
            sortCards();
            evaluateHands();
            RobotCall();
        }
Exemplo n.º 2
0
 public void Deal()
 {
     SetUpDeck(); // create
     DrawCards.ListCard(this);
     // CreateButton();
     getFlop();
 }
Exemplo n.º 3
0
 public void displayCardsPlayers()
 {
     for (int i = 0; i < 2; i++)
     {
         DrawCards.DrawCardSuitValue(playerHand[i], i, this);
     }
     for (int i = 2; i < 4; i++)
     {
         DrawCards.DrawCardSuitValue(pcHand[i - 2], i, this);
     }
 }
Exemplo n.º 4
0
        public void ResultBank()
        {
            Label myLabel = Control.Find("Result", true).FirstOrDefault() as Label;

            if (myLabel.Text.IndexOf("Player WIN") >= 0)
            {
                TextBox PlayerTexB = Control.Find("textBox1", true).FirstOrDefault() as TextBox;
                TextBox AllTexB    = Control.Find("textBox3", true).FirstOrDefault() as TextBox;
                if (AllTexB.Text == "")
                {
                    AllTexB.Text = "0";
                }
                PlayerTexB.Text = Convert.ToString(Convert.ToInt32(PlayerTexB.Text) + Convert.ToInt32(AllTexB.Text));
                AllTexB.Text    = "";
            }
            else if (myLabel.Text.IndexOf("PC WIN") >= 0)
            {
                Label RobotCombo = Control.Find("label9", true).FirstOrDefault() as Label;
                RobotCombo.Visible = true;
                for (int i = 2; i < 4; i++)
                {
                    DrawCards.DrawCardSuitValueRobot(pcHand[i - 2], i, this);
                }
                TextBox PCTexB  = Control.Find("textBox2", true).FirstOrDefault() as TextBox;
                TextBox AllTexB = Control.Find("textBox3", true).FirstOrDefault() as TextBox;
                if (AllTexB.Text == "")
                {
                    AllTexB.Text = "0";
                }
                PCTexB.Text  = Convert.ToString(Convert.ToInt32(PCTexB.Text) + Convert.ToInt32(AllTexB.Text));
                AllTexB.Text = "";
            }
            else
            {
                TextBox PCTexB     = Control.Find("textBox2", true).FirstOrDefault() as TextBox;
                TextBox PlayerTexB = Control.Find("textBox1", true).FirstOrDefault() as TextBox;
                TextBox AllTexB    = Control.Find("textBox3", true).FirstOrDefault() as TextBox;
                if (AllTexB.Text == "")
                {
                    AllTexB.Text = "0";
                }
                PCTexB.Text     = Convert.ToString(Convert.ToInt32(PCTexB.Text) + Convert.ToInt32(AllTexB.Text) / 2);
                PlayerTexB.Text = Convert.ToString(Convert.ToInt32(PlayerTexB.Text) + Convert.ToInt32(AllTexB.Text) / 2);
                AllTexB.Text    = "";
            }
        }
Exemplo n.º 5
0
 public void Result()
 {
     if (who == "Player")
     {
         TextBox PCTexB  = Control.Find("textBox2", true).FirstOrDefault() as TextBox;
         TextBox AllTexB = Control.Find("textBox3", true).FirstOrDefault() as TextBox;
         if (AllTexB.Text == "")
         {
             AllTexB.Text = "0";
         }
         PCTexB.Text = Convert.ToString(Convert.ToInt32(PCTexB.Text) + Convert.ToInt32(AllTexB.Text));
         Button flopbutton  = Control.Find("FlopButton", true).FirstOrDefault() as Button;
         Button TernButton  = Control.Find("TernButton", true).FirstOrDefault() as Button;
         Button RiverButton = Control.Find("RiverButton", true).FirstOrDefault() as Button;
         AllTexB.Text        = "";
         flopbutton.Enabled  = true;
         flopbutton.Visible  = true;
         TernButton.Visible  = false;
         RiverButton.Visible = false;
         //  fold = true;
         DrawCards.VisibleCards();
     }
     else if (who == "Robot")
     {
         TextBox PlayerTexB = Control.Find("textBox1", true).FirstOrDefault() as TextBox;
         TextBox AllTexB    = Control.Find("textBox3", true).FirstOrDefault() as TextBox;
         if (AllTexB.Text == "")
         {
             AllTexB.Text = "0";
         }
         PlayerTexB.Text = Convert.ToString(Convert.ToInt32(PlayerTexB.Text) + Convert.ToInt32(AllTexB.Text));
         Button flopbutton  = Control.Find("FlopButton", true).FirstOrDefault() as Button;
         Button TernButton  = Control.Find("TernButton", true).FirstOrDefault() as Button;
         Button RiverButton = Control.Find("RiverButton", true).FirstOrDefault() as Button;
         AllTexB.Text        = "";
         flopbutton.Enabled  = true;
         flopbutton.Visible  = true;
         TernButton.Visible  = false;
         RiverButton.Visible = false;
         //  fold = true;
         DrawCards.VisibleCards();
     }
 }
Exemplo n.º 6
0
        public void getRiver()
        {
            // for player & PC  7
            for (int i = 6; i < 7; i++)
            {
                playerHand[i] = getDeck[i + 2]; //7
                pcHand[i]     = playerHand[i];
                Dilir[i - 2]  = playerHand[i];  // 5
            }
            for (int i = 9; i < 10; i++)        //5
            {
                DrawCards.DrawCardSuitValue(Dilir[i - 5], i, this);
            }
            sortCards();
            evaluateHands();
            // RobotCall();
            ResultBank();
            Label myLabel = Control.Find("Result", true).FirstOrDefault() as Label;

            MessageBox.Show(myLabel.Text);
        }
Exemplo n.º 7
0
 public void getTern()
 {
     // for player & PC  6
     for (int i = 5; i < 6; i++)
     {
         playerHand[i] = getDeck[i + 2]; //6
         pcHand[i]     = new Card {
             MySuit = getDeck[i + 2].MySuit, MyValue = getDeck[i + 2].MyValue, count = 0
         };
         Dilir[i - 2] = new Card {
             MySuit = getDeck[i + 2].MySuit, MyValue = getDeck[i + 2].MyValue, count = 0
         };                      // 4
     }
     for (int i = 8; i < 9; i++) // 4
     {
         DrawCards.DrawCardSuitValue(Dilir[i - 5], i, this);
     }
     sortCards();
     evaluateHands();
     RobotCall();
 }