Esempio n. 1
0
 public AIPlayer(int cash,int id,Table t)
 {
     cards = new List<MyCard.Card>(2);
     this.cash = cash;
     this.table = t;
     this.folded = false;
 }
 public AI(Player AIPlayer,
           Table t,
           int strategyType,
           int call,
           double winChance,
           int playerCount,
           double randomFactorForWinChance,
           double randomFactorForMyBet)
 {
     this.me = AIPlayer;
     this.table = t;
     this.strategyType = strategyType;
     this.call = call;
     this.winChance = winChance;
     this.playerCount = playerCount;
     this.factorForMyBet = randomFactorForMyBet;
     this.factorForWinChance = randomFactorForWinChance;
     this.smallRaise = ((factorForMyBet / 2) * me.cash) / 100;
     this.bigRaise = (factorForMyBet * me.cash) / 100;
     if (smallRaise < call)
         smallRaise = call;
     if (bigRaise < call)
         bigRaise = call;
     strategyForAI();
 }
Esempio n. 3
0
 public HumanPlayer(int cash, int i, Table t)
 {
     cards = new List<MyCard.Card>(2);
     this.cash = cash;
     this.id = i;
     this.table = t;
     this.folded = false;
 }
 public AIPlayer(int cash,int id,Table t,Parameters p)
 {
     cards = new List<MyCard.Card>(2);
     this.cash = cash;
     this.id = id;
     this.table = t;
     this.folded = false;
     this.par = p;
 }
 public IncInformationForm()
 {
     InitializeComponent();
     this.CreateHandle();
     groupVisuals();
     PostInit();
     cardIterator.Add(P1C1);
     cardIterator.Add(P1C2);
     cardIterator.Add(P2C1);
     cardIterator.Add(P2C2);
     cardIterator.Add(P3C1);
     cardIterator.Add(P3C2);
     cardIterator.Add(P4C1);
     cardIterator.Add(P4C2);
     cardIterator.Add(P5C1);
     cardIterator.Add(P5C2);
     cardIterator.Add(P6C1);
     cardIterator.Add(P6C2);
     cardIterator.Add(P7C1);
     cardIterator.Add(P7C2);
     cardIterator.Add(P8C1);
     cardIterator.Add(P8C2);
     cashIterator.Add(P1Cash);
     cashIterator.Add(P2Cash);
     cashIterator.Add(P3Cash);
     cashIterator.Add(P4Cash);
     cashIterator.Add(P5Cash);
     cashIterator.Add(P6Cash);
     cashIterator.Add(P7Cash);
     cashIterator.Add(P8Cash);
     betIterator.Add(P1Bet);
     betIterator.Add(P2Bet);
     betIterator.Add(P3Bet);
     betIterator.Add(P4Bet);
     betIterator.Add(P5Bet);
     betIterator.Add(P6Bet);
     betIterator.Add(P7Bet);
     betIterator.Add(P8Bet);
     playernum = 8;
     aiNUm = 0;
     restart = false;
     table = new Table(new Deck(), playernum, this);
     table.startTable();
     /*
     cardIterator.Add(Flop1);
     cardIterator.Add(Flop2);
     cardIterator.Add(Flop3);
     cardIterator.Add(River);
     cardIterator.Add(Turn);
     */
 }
 public void newTable()
 {
     table = new Table(new Deck(), playernum, this);
 }
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (ComboPlayerCount.SelectedIndex)
            {
                case 0:
                    playernum = 2;
                    playerVis[2].hide();
                    playerVis[3].hide();
                    playerVis[4].hide();
                    playerVis[5].hide();
                    playerVis[6].hide();
                    playerVis[7].hide();
                    break;

                case 1:
                    playernum = 3;
                    playerVis[2].show();
                    playerVis[3].hide();
                    playerVis[4].hide();
                    playerVis[5].hide();
                    playerVis[6].hide();
                    playerVis[7].hide();
                    break;
                case 2:
                    playernum = 4;
                    playerVis[2].show();
                    playerVis[3].show();
                    playerVis[4].hide();
                    playerVis[5].hide();
                    playerVis[6].hide();
                    playerVis[7].hide();
                    break;
                case 3:
                    playernum = 5;
                    playerVis[2].show();
                    playerVis[3].show();
                    playerVis[4].show();
                    playerVis[5].hide();
                    playerVis[6].hide();
                    playerVis[7].hide();
                    break;
                case 4:
                    playernum = 6;
                    playerVis[2].show();
                    playerVis[3].show();
                    playerVis[4].show();
                    playerVis[5].show();
                    playerVis[6].hide();
                    playerVis[7].hide();
                    break;
                case 5:
                    playernum = 7;
                    playerVis[2].show();
                    playerVis[3].show();
                    playerVis[4].show();
                    playerVis[5].show();
                    playerVis[6].show();
                    playerVis[7].hide();
                    break;
                case 6:
                    playernum = 8;
                    playerVis[2].show();
                    playerVis[3].show();
                    playerVis[4].show();
                    playerVis[5].show();
                    playerVis[6].show();
                    playerVis[7].show();
                    break;
            }
            resetPlayerBoxes();

            table = new Table(new Deck(), playernum, this);
            foreach (Player p in table.players)
            {
                playerVis[p.id].money.Text = p.cash.ToString();
            }
            table.resetTable();
            vizualize();
            table.startTable();
        }
 public void newTable()
 {
     table = new Table(new Deck(), playernum, this);
     resetPlayerBoxes();
     table.startTable();
 }
 public Deal(Table t)
 {
     this.table = t;
 }