Пример #1
0
        private void buttonFold_Click(object sender, EventArgs e)
        {
            PlayerActionEventArgs args = new PlayerActionEventArgs
            {
                Action = PlayerAction.Fold
            };

            PokerEventsMediator.OnPlayerAction(null, args);
        }
Пример #2
0
        private void buttonAddPlayer_Click(object sender, EventArgs e)
        {
            PlayerDataEventArgs args = new PlayerDataEventArgs
            {
                Name  = textBoxPlayerName.Text.ToString(),
                Chips = Int32.Parse(textBoxChips.Text.ToString())
            };

            PokerEventsMediator.OnAddPlayer(null, args);
        }
Пример #3
0
        private void buttonBet_Click(object sender, EventArgs e)
        {
            labelPot.Text = (Int32.Parse(labelPot.Text.ToString()) + trackBar1.Value).ToString();
            PlayerActionEventArgs args = new PlayerActionEventArgs {
                BetAmount = trackBar1.Value,
                Action    = PlayerAction.Bet
            };

            PokerEventsMediator.OnPlayerAction(null, args);
        }
Пример #4
0
 private void RefreshClock()
 {
     while (true)
     {
         MethodInvoker mi = delegate() {
             double timeleft = Clock.GetTimeLeft().TotalSeconds;
             if (timeleft <= 0)
             {
                 Clock.StopClock();
                 PlayerActionEventArgs args = new PlayerActionEventArgs {
                     Action = PlayerAction.Fold
                 };
                 PokerEventsMediator.OnPlayerAction(null, args);
             }
             label1.Text = Clock.GetTimeLeft().ToString(@"hh\:mm\:ss");      // hh\:mm\:ss\:fff
         };
         this.Invoke(mi);
     }
 }