Exemplo n.º 1
0
        public PokerTable()
        {
            this.handType = new HandType();
            this.assertHandType = new AssertHandType();
            this.pokerDatabase = new PokerDatabase();
            this.human = new Human("Player");
            this.bots = new List<IBot>(5);
            this.cardsImageLocation = Directory.GetFiles(
                "..\\..\\Resources\\Assets\\Cards",
                "*.png",
                SearchOption.TopDirectoryOnly);
            this.reservedGameCardsIndeces = new int[Constants.NeededCardsFromDeck];
            this.deckImages = new Image[Constants.CardsInADeck];
            this.cardsPictureBoxList = new PictureBox[Constants.CardsInADeck];

            //pokerDatabasePlayersGameStatus.Add(humanOutOfChips); pokerDatabasePlayersGameStatus.Add(firstBotOutOfChips); pokerDatabasePlayersGameStatus.Add(secondBotOutOfChips); pokerDatabasePlayersGameStatus.Add(thirdBotOutOfChips); pokerDatabasePlayersGameStatus.Add(fourthBotOutOfChips); pokerDatabasePlayersGameStatus.Add(fifthBotOutOfChips);
            this.bigBlindValue = Constants.MinBigBlindValue;
            this.smallBlindValue = Constants.MinSmallBlindValue;
            this.neededChipsToCall = this.bigBlindValue;
            this.secondsToMakeTurn = Constants.DefaultSecondsToMakeTurn;
            this.foldedBotsCount = Constants.DefaultBotsCount;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.updates.Start();
            this.bots = new List<IBot>();
            this.PopulateBots();
            this.InitializeComponent();
            this.InitializePlayersDisplay();
            this.width = this.Width;
            this.height = this.Height;
            this.Shuffle();
            this.potStatus.Enabled = false;
            this.txtBoxHumanChips.Enabled = false;
            this.txtBoxHumanChips.Text = "Chips : " + this.human.Chips;
            this.PopulateBotChips();
            this.timer.Interval = 1 * 1 * 1000;
            this.timer.Tick += this.TimerTick;
            this.updates.Interval = 1 * 1 * 100;
            this.updates.Tick += this.UpdateTick;
            this.tbBigBlind.Visible = true;
            this.tbSmallBlind.Visible = true;
            this.buttonBigBlind.Visible = true;
            this.buttonSmallBlind.Visible = true;
            this.tbBigBlind.Visible = true;
            this.tbSmallBlind.Visible = true;
            this.buttonBigBlind.Visible = true;
            this.buttonSmallBlind.Visible = true;
            this.tbBigBlind.Visible = false;
            this.tbSmallBlind.Visible = false;
            this.buttonBigBlind.Visible = false;
            this.buttonSmallBlind.Visible = false;
            this.tbRaise.Text = (this.bigBlindValue * 2).ToString();
        }
Exemplo n.º 2
0
        public PokerTable(IDealer dealer, ICheckHandType checkHand, IHandType handType, IWriter messageBoxWriter)
        {
            this.Player = new PokerPlayer(new Panel());
            this.FirstBot = new PokerPlayer(new Panel());
            this.SecondBot = new PokerPlayer(new Panel());
            this.ThirdBot = new PokerPlayer(new Panel());
            this.FourthBot = new PokerPlayer(new Panel());
            this.FifthBot = new PokerPlayer(new Panel());

            this.Dealer = dealer;
            this.CheckHand = checkHand;
            this.HandType = handType;
            this.messageBoxWriter = messageBoxWriter;

            this.neededChipsToCall = this.bigBlind;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.updates.Start();
            this.InitializeComponent();

            this.Shuffle();

            this.potStatus.Enabled = false;
            this.playerChips.Enabled = false;
            this.botOneChips.Enabled = false;
            this.botTwoChips.Enabled = false;
            this.botThreeChips.Enabled = false;
            this.botFourChips.Enabled = false;
            this.botFiveChips.Enabled = false;

            this.playerChips.Text = "Chips : " + this.Player.Chips;
            this.botOneChips.Text = "Chips : " + this.FirstBot.Chips;
            this.botTwoChips.Text = "Chips : " + this.SecondBot.Chips;
            this.botThreeChips.Text = "Chips : " + this.ThirdBot.Chips;
            this.botFourChips.Text = "Chips : " + this.FourthBot.Chips;
            this.botFiveChips.Text = "Chips : " + this.FifthBot.Chips;

            this.timer.Interval = 1000;
            this.timer.Tick += this.TimerTick;
            this.updates.Interval = 100;
            this.updates.Tick += this.Update_Tick;

            this.raiseAmountField.Text = (this.bigBlind * 2).ToString();

            this.Player.OutOfChips = false;
            this.Player.AbleToMakeTurn = true;
        }