public static TableDisplayWindow CreateForTable(Table t)
 {
     switch(t.Game){
         case PokerGame.Holdem:
             return new HoldemTableDisplayWindow(t);
         default:
             return new InvisibleTableDisplayWindow(t);
     }
 }
        private Table table; //Reference to the table that owns this display

        #endregion Fields

        #region Constructors

        public TableDisplayWindow(Table table)
        {
            InitializeComponent();
            this.lastPlayerHand = null;
            this.table = table;
            this.oddsCalculator = OddsCalculator.CreateFor(table.Game);
            this.DoubleBuffered = true;
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.Size = LoadWindowSize();
            this.Location = LoadAbsoluteWindowPosition();
        }
        public VisualRecognitionManager(Table table, IVisualRecognitionManagerHandler handler)
        {
            Trace.Assert(table.Game != PokerGame.Unknown, "Cannot create a visual recognition manager without knowing the game of the table");
            Trace.Assert(table.WindowRect != Rectangle.Empty, "Cannot create a visual recognition manager without knowing the window rect");

            this.table = table;
            this.handler = handler;
            this.colorMap = ColorMap.Create(table.Game);
            this.recognitionMap = new VisualRecognitionMap(table.VisualRecognitionMapLocation, colorMap);
            this.matcher = new VisualMatcher(Globals.UserSettings.CurrentPokerClient);
            this.tableWindow = new Window(table.WindowTitle);

            this.timedScreenshotTaker = new TimedScreenshotTaker(REFRESH_TIME, tableWindow);
            this.timedScreenshotTaker.ScreenshotTaken += new TimedScreenshotTaker.ScreenshotTakenHandler(timedScreenshotTaker_ScreenshotTaken);
            this.timedScreenshotTaker.Start();
        }
Beispiel #4
0
        public override void RegisterHandlers(Hud hud, Table t, Player p)
        {
            base.RegisterHandlers(hud, t, p);

            this.OnPlayerPreflopPushingRangeNeedToBeDisplayed += new OnPlayerPreflopPushingRangeNeedToBeDisplayedHandler(hud.holdemWindow_OnPlayerPreflopPushingRangeNeedToBeDisplayed);
        }
Beispiel #5
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);
 }
 public InvisibleTableDisplayWindow(Table table)
     : base(table)
 {
     this.Visible = false;
 }
 public HoldemTableStatistics(Table table)
     : base(table)
 {
     PrepareStatisticsForNewRound();
 }
Beispiel #8
0
 /* Shift the position of the hud */
 void ShiftHud(Table t)
 {
     RunGUIRoutine((Action)delegate()
     {
         t.Hud.Shift();
     },
     true);
 }
Beispiel #9
0
 private void SetHudVisible(Table t, bool visible)
 {
     RunGUIRoutine((Action)delegate()
     {
         t.Hud.Visible = visible;
     },
     true);
 }
Beispiel #10
0
        private void FindHandHistory(string pattern,string windowTitle)
        {
            // Do we have a filename matching this window?
            String filename = HHDirectoryParser.GetHandHistoryFilenameFromRegexPattern(Globals.UserSettings.HandHistoryDirectory, pattern);

            if (filename != String.Empty) {
                String filePath = Globals.UserSettings.HandHistoryDirectory + @"\" + filename;

                // A valid filename was found to be associated with a window title, see if we have a table already
                Table table = FindTableByHHFilePath(filePath);

                // Is there a game associated with this filename?
                if (table == null) {
                    // First time we see it, we need to create a table for this request
                    Table newTable = new Table(filePath, new Window(windowTitle), pokerClient, playerDatabase);

                    // and add it to our list
                    tables.Add(newTable);

                    Trace.WriteLine("Created new table: " + newTable.WindowTitle + " on " + newTable.HandHistoryFilePath);

                    OnDisplayStatus("Parsing for the first time... please wait.");

                    // Check for changes, now!
                    newTable.ParseHandHistoryNow();
                } else {
                    // Inform the UI that we might need to shift the hud
                    ShiftHud(table);
                }

                OnDisplayStatus("Focus is on the table associated with " + filename);
                Trace.WriteLine(String.Format("Valid window title match with {0}", filename));
            } else {
                OnDisplayStatus("New game started on window: " + windowTitle);
                Trace.WriteLine(String.Format("A valid window title was found ({0}) but no filename associated with the window could be found using pattern {1}. Is this our first hand at the table and no hand history is available?", windowTitle, pattern));
            }
        }
Beispiel #11
0
 /* TEST CODE REMOVE IN PRODUCTION */
 public void Test()
 {
     String filename = "test.txt";
     //String filename = "HH20110305 T371715473 No Limit Hold'em €4.46 + €0.54.txt";
     Table newTable = new Table(filename, new Window("test.txt - Notepad"), pokerClient, playerDatabase);
     tables.Add(newTable);
 }