Exemple #1
0
        /* In this method we take care of updating UI information
         * about this table */
        private void UpdateUI()
        {
            Trace.WriteLine("Refresh UI for " + GameID);

            Globals.Director.OnDisplayStatus("Displaying Table #" + TableId);

            // Flag to keep track of whether at least one mucked hand is available
            bool muckedHandsAvailable = false;

            // Check which players have shown their cards
            List <Player> showdownPlayers = new List <Player>();

            foreach (Player p in PlayerList)
            {
                // If it has showed and it's not us
                if (p.HasShowedThisRound && p.Name != CurrentHeroName)
                {
                    showdownPlayers.Add(p);
                    muckedHandsAvailable = true;
                }
            }

            if (muckedHandsAvailable)
            {
                Globals.Director.RunFromGUIThread(
                    (Action) delegate()
                {
                    if (DisplayWindow != null)
                    {
                        DisplayWindow.ClearMuck();
                    }
                }, false
                    );

                foreach (Player p in showdownPlayers)
                {
                    Globals.Director.RunFromGUIThread(
                        (Action) delegate()
                    {
                        if (DisplayWindow != null)
                        {
                            DisplayWindow.DisplayPlayerMuckedHand(p.Name, p.MuckedHand);
                        }
                    }, false
                        );
                }

                if (FinalBoard != null && !FinalBoard.Displayed)
                {
                    Globals.Director.RunFromGUIThread(
                        (Action) delegate()
                    {
                        if (DisplayWindow != null)
                        {
                            DisplayWindow.DisplayFinalBoard(FinalBoard);
                        }
                    }, false
                        );
                    FinalBoard.Displayed = true;
                }
            }


            Globals.Director.RunFromGUIThread(
                (Action) delegate()
            {
                // Display hud information
                if (Hud != null)
                {
                    Hud.DisplayAndUpdate();
                }

                // Update statistics
                if (DisplayWindow != null)
                {
                    DisplayWindow.UpdateStatistics();
                }
            }, true
                );
        }
        public override void RegisterHandlers(Hud hud, Table t, Player p)
        {
            base.RegisterHandlers(hud, t, p);

            this.OnPlayerPreflopPushingRangeNeedToBeDisplayed += new OnPlayerPreflopPushingRangeNeedToBeDisplayedHandler(hud.holdemWindow_OnPlayerPreflopPushingRangeNeedToBeDisplayed);
        }
        public override void RegisterHandlers(Hud hud, Table t, Player p)
        {
            base.RegisterHandlers(hud, t, p);

            this.OnPlayerPreflopPushingRangeNeedToBeDisplayed += new OnPlayerPreflopPushingRangeNeedToBeDisplayedHandler(hud.holdemWindow_OnPlayerPreflopPushingRangeNeedToBeDisplayed);
        }
Exemple #4
0
 public virtual void RegisterHandlers(Hud hud, Table t, Player p)
 {
     this.OnResetStatisticsButtonPressed += new HudWindow.OnResetStatisticsButtonPressedHandler(p.window_OnResetStatisticsButtonPressed);
     this.OnResetAllStatisticsButtonPressed += new HudWindow.OnResetAllStatisticsButtonPressedHandler(t.window_OnResetAllStatisticsButtonPressed);
     this.OnPlayerStatisticsNeedToBeDisplayed += new HudWindow.OnPlayerStatisticsNeedToBeDisplayedHandler(hud.window_OnPlayerStatisticsNeedToBeDisplayed);
     this.LocationChanged += new EventHandler(hud.window_LocationChanged);
 }