Beispiel #1
0
        public Table(String handHistoryFilePath, Window window, PokerClient pokerClient, PlayerDatabase playerDatabase)
        {
            this.handHistoryFilePath = handHistoryFilePath;
            this.window = window;
            this.pokerClient = pokerClient;
            this.playerDatabase = playerDatabase;
            this.Game = PokerGame.Unknown;
            this.maxSeatingCapacity = 0; // We don't know yet
            this.TableId = String.Empty; // We don't know yet
            this.GameID = String.Empty; // We don't know yet
            this.currentHeroName = String.Empty;
            this.currentHeroSeat = 0;
            this.gameType = pokerClient.GetPokerGameTypeFromWindowTitle(WindowTitle);
            this.statistics = new TableStatistics(this); // We don't know what specific kind
            this.Hud = new Hud(this);
            this.visualRecognitionManager = null; // Not all tables have a visual recognition manager
            this.displayWindow = DaCMain.TableDisplayWindow.CreateForTable(this);

            // By default we use the universal parser
            handHistoryParser = new UniversalHHParser(pokerClient, System.IO.Path.GetFileName(handHistoryFilePath));

            // But as soon as we find what kind of game we're using, we're going to update our parser */
            ((UniversalHHParser)handHistoryParser).GameDiscovered += new UniversalHHParser.GameDiscoveredHandler(handHistoryParser_GameDiscovered);

            playerList = new List<Player>(10); //Usually no more than 10 players per table

            // Init hand history monitor
            hhMonitor = new HHMonitor(handHistoryFilePath, this);
            hhMonitor.StartMonitoring();
        }
Beispiel #2
0
        /* This will force subclasses to have a PokerClient in their constructor as well */
        public HHParser(PokerClient pokerClient, String handhistoryFilename)
        {
            this.pokerClient = pokerClient;
            this.handhistoryFilename = handhistoryFilename;

            endOfRoundTokensDetected = 0;
        }
Beispiel #3
0
        public VisualMatcher(PokerClient client)
        {
            this.client = client;
            this.cardMatchFiles = new List<String>();
            this.cardMatchDialogSpawnLocation = new Point(200, 200);

            ReplicateCommonCardsForCurrentClient();
            LoadCardMatchFilesList();
        }
Beispiel #4
0
        public HoldemHHParser(PokerClient pokerClient, String handhistoryFilename)
            : base(pokerClient, handhistoryFilename)
        {
            // Initialize vars
            PlayerHasShowedThisRound = false;
            ShowdownEventRaised = false;
            boardCards = new List<Card>(5);

            playerSeats = new Hashtable();
            lastButtonSeatNumber = 0;

            // Setup handler from parent class that detects the end of a round
            base.RoundHasTerminated += new RoundHasTerminatedHandler(HoldemHHParser_RoundHasTerminated);

            // Also call it the first time from here
            SetupNewRound();
        }
Beispiel #5
0
        private void LoadPokerClientThemes(PokerClient client)
        {
            if (client.SupportedVisualRecognitionThemes.Count > 0) {
                cmbPokerClientTheme.DataSource = client.SupportedVisualRecognitionThemes;
                cmbPokerClientTheme.Enabled = true;

                // If a colormap became available during the last update, CurrentTheme needs to be changed
                if (client.CurrentTheme == "") {
                    client.SetTheme(client.SupportedVisualRecognitionThemes[0].ToString());

                    // Force save settings
                    Globals.UserSettings.CurrentPokerClient = client;

                    // Commit
                    Globals.UserSettings.Save();
                }
            } else {
                ArrayList list = new ArrayList();
                list.Add("Feature not yet supported");
                cmbPokerClientTheme.DataSource = list;
                cmbPokerClientTheme.Enabled = false;
            }
        }
Beispiel #6
0
 /* Loads the languages available for a specific client */
 private void LoadPokerClientLanguages(PokerClient client)
 {
     cmbPokerClientLanguage.DataSource = client.SupportedLanguages;
 }
 private void LoadPokerClientThemes(PokerClient client)
 {
     if (client.SupportedVisualRecognitionThemes.Count > 0)
     {
         cmbPokerClientTheme.DataSource = client.SupportedVisualRecognitionThemes;
         cmbPokerClientTheme.Enabled = true;
     }
     else
     {
         ArrayList list = new ArrayList();
         list.Add("Feature not yet supported");
         cmbPokerClientTheme.DataSource = list;
         cmbPokerClientTheme.Enabled = false;
     }
 }
 public static void SetDefault(PokerClient client)
 {
     defaultClient = client;
 }
 /* Adds a poker client to the list of supported clients */
 public static void Add(PokerClient client)
 {
     clientList.Add(client.Name, client);
 }
 public void SetHandHistoryDirectoryFor(PokerClient client, String directory)
 {
     String key = client.XmlName + "_hand_history_directory";
     SetSetting(key, directory);
 }
 public String GetHandHistoryDirectoryFor(PokerClient client)
 {
     String key = client.XmlName + "_hand_history_directory";
     // Has the user ever specified a directory for this client?
     if (HasSetting(key))
     {
         return (String)GetSetting(key);
     }
     else return String.Empty;
 }
Beispiel #12
0
        /* Change the poker client */
        public void ChangePokerClient(PokerClient client)
        {
            Globals.UserSettings.CurrentPokerClient = client;
            pokerClient = client;

            // Also change directory
            ChangeHandHistoryDirectory(Globals.UserSettings.StoredHandHistoryDirectory);

            String check=Globals.UserSettings.ChatHistoryDirectory;

            // On load certain operations might need to be done by the client
            Globals.UserSettings.CurrentPokerClient.DoStartupProcessing(Globals.UserSettings.StoredHandHistoryDirectory);
        }
 public UniversalHHParser(PokerClient pokerClient, String handhistoryFilename)
     : base(pokerClient, handhistoryFilename)
 {
     reGameType = pokerClient.GetRegex("hand_history_game_token");
 }