示例#1
0
        private void OnDeliveryBatonToPlayer(UpdateControlsArgs e)
        {
            EventHandler delivery = DeliveryBatonToPlayer;

            if (delivery != null)
            {
                delivery(this, e);
            }
        }
示例#2
0
        private void OnReceiveUpdateControls(UpdateControlsArgs e)
        {
            EventHandler update = ReceiveUpdateControls;

            if (update != null)
            {
                update(this, e);
            }
        }
示例#3
0
文件: Render.cs 项目: alexsotn/Poker
        private void game_ReceiveUpdateControls(object sender, EventArgs e)
        {
            UpdateControlsArgs args = e as UpdateControlsArgs;

            if (!args.player.AllIn)
            {
                mainform.labelTabelMyBet.Text = "Ставка: " + game.table.mainplayer.stepBet.ToString();
                if (game.table.players[0] == game.table.mainplayer)
                {
                    mainform.labelTableAIBet.Text = "Ставка: " + game.table.players[1].stepBet.ToString();
                }
                else
                {
                    mainform.labelTableAIBet.Text = "Ставка: " + game.table.players[0].stepBet.ToString();
                }

                if (game.table.HowMuchToCall() == game.table.mainplayer.stepBet)
                {
                    mainform.buttonCheck.Enabled = true;
                }
                else
                {
                    mainform.buttonCall.Enabled = true;
                    mainform.buttonFold.Enabled = true;
                }
                mainform.buttonRaise.Enabled = true;
                mainform.buttonRaise.Enabled = true;
                if (game.table.mainplayer.Stack >= game.table.sblind * 6)
                {
                    mainform.trackbarBet.Minimum = (game.table.sblind * 6);
                }
                else
                {
                    mainform.trackbarBet.Minimum = game.table.mainplayer.Stack;
                }
                mainform.trackbarBet.Value   = mainform.trackbarBet.Minimum;
                mainform.trackbarBet.Maximum = game.table.mainplayer.Stack;
                mainform.trackbarBet.Enabled = true;
                mainform.pbAI1.Image         = Poker_Alex_Sotnikov.Properties.Resources.waiting;
                mainform.pbMainPlayer.Image  = Poker_Alex_Sotnikov.Properties.Resources.active;


                mainform.mytime.Visible        = true;
                mainform.mytime.Value          = 30;
                mainform.labelYourMove.Visible = true;
                mainform.playersTime.Enabled   = true;
                mainform.playersTime.Interval  = 1000;
                mainform.playersTime.Start();
            }
        }
示例#4
0
文件: Players.cs 项目: alexsotn/Poker
        public override void table_BatonMoved(object sender, EventArgs e)
        {
            UpdateControlsArgs args = e as UpdateControlsArgs;

            if ((this == args.player) && (args.player.AllIn))
            {
                if (timer.Enabled == true)
                {
                    return;
                }
                else
                {
                    timer.Enabled = true;
                }
                timer.Interval = 1000;
                timer.Start();
            }
        }
示例#5
0
文件: Players.cs 项目: alexsotn/Poker
        public override void table_BatonMoved(object sender, EventArgs e)
        {
            UpdateControlsArgs args = e as UpdateControlsArgs;

            if (this == args.player)
            {
                Random random = new Random();
                toCall = args.toCall;
                sblind = args.sblind;
                if (timer.Enabled == true)
                {
                    return;
                }
                else
                {
                    timer.Enabled = true;
                }
                timer.Interval = random.Next(1, 5) * 1000;
                timer.Start();
            }
        }