Exemplo n.º 1
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;
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 3
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 = PokerMuck.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();
        }
Exemplo n.º 4
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            = PokerMuck.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();
        }
Exemplo n.º 5
0
        /* Pokerclient language has changed, initialize the new config */
        private void cmbPokerClientLanguage_SelectionChangeCommitted(object sender, EventArgs e)
        {
            PokerClient client = userSettings.CurrentPokerClient;

            client.InitializeLanguage(cmbPokerClientLanguage.Text);

            userSettings.CurrentPokerClient = client;
        }
Exemplo n.º 6
0
        private void cmbPokerClientTheme_SelectionChangeCommitted(object sender, EventArgs e)
        {
            PokerClient client = userSettings.CurrentPokerClient;

            client.SetTheme(cmbPokerClientTheme.Text);

            userSettings.CurrentPokerClient = client;
        }
Exemplo n.º 7
0
        private void cmbPokerClientTheme_SelectionChangeCommitted(object sender, EventArgs e)
        {
            PokerClient client = Globals.UserSettings.CurrentPokerClient;

            client.SetTheme(cmbPokerClientTheme.Text);

            // Tell directory that we have changed the client
            Globals.Director.ChangePokerClient(client);
        }
Exemplo n.º 8
0
        public VisualMatcher(PokerClient client)
        {
            this.client = client;
            this.cardMatchFiles = new List<String>();
            this.cardMatchDialogSpawnLocation = new Point(200, 200);

            ReplicateCommonCardsForCurrentClient();
            LoadCardMatchFilesList();
        }
Exemplo n.º 9
0
        public VisualMatcher(PokerClient client)
        {
            this.client         = client;
            this.cardMatchFiles = new List <String>();
            this.cardMatchDialogSpawnLocation = new Point(200, 200);

            ReplicateCommonCardsForCurrentClient();
            LoadCardMatchFilesList();
        }
Exemplo n.º 10
0
        /* Pokerclient has changed, store in config and load available languages */
        private void cmbPokerClient_SelectionChangeCommitted(object sender, EventArgs e)
        {
            PokerClient client = PokerClientsList.Find(cmbPokerClient.Text);

            client.InitializeLanguage(client.DefaultLanguage);

            LoadPokerClientLanguages(client);
            LoadPokerClientThemes(client);

            userSettings.CurrentPokerClient = client;
        }
Exemplo n.º 11
0
        /* Change the poker client */
        public void ChangePokerClient(PokerClient client)
        {
            Globals.UserSettings.CurrentPokerClient = client;
            pokerClient = client;

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

            // On load certain operations might need to be done by the client
            Globals.UserSettings.CurrentPokerClient.DoStartupProcessing(Globals.UserSettings.StoredHandHistoryDirectory);
        }
Exemplo n.º 12
0
        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);
            }
        }
Exemplo n.º 13
0
        /* Pokerclient has changed, store in config and load available languages */
        private void cmbPokerClient_SelectionChangeCommitted(object sender, EventArgs e)
        {
            PokerClient client = PokerClientsList.Find(cmbPokerClient.Text);

            client.InitializeLanguage(client.DefaultLanguage);

            LoadPokerClientLanguages(client);
            LoadPokerClientThemes(client);

            client.SetTheme(cmbPokerClientTheme.Text);
            Globals.Director.ChangePokerClient(client);

            // Refresh hand history directory
            txtHandHistoryDirectory.Text = Globals.UserSettings.StoredHandHistoryDirectory;
        }
Exemplo n.º 14
0
 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;
     }
 }
Exemplo n.º 15
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();
        }
Exemplo n.º 16
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();
        }
Exemplo n.º 17
0
 public void SetHandHistoryDirectoryFor(PokerClient client, String directory)
 {
     String key = client.XmlName + "_hand_history_directory";
     SetSetting(key, directory);
 }
Exemplo n.º 18
0
 /* Adds a poker client to the list of supported clients */
 public static void Add(PokerClient client)
 {
     clientList.Add(client.Name, client);
 }
Exemplo n.º 19
0
 public static void SetDefault(PokerClient client)
 {
     defaultClient = client;
 }
Exemplo n.º 20
0
 public UniversalHHParser(PokerClient pokerClient, String handhistoryFilename)
     : base(pokerClient, handhistoryFilename)
 {
     reGameType = pokerClient.GetRegex("hand_history_game_token");
 }
Exemplo n.º 21
0
 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;
 }
Exemplo n.º 22
0
 public UniversalHHParser(PokerClient pokerClient, String handhistoryFilename)
     : base(pokerClient, handhistoryFilename)
 {
     reGameType = pokerClient.GetRegex("hand_history_game_token");
 }
Exemplo n.º 23
0
 public static void SetDefault(PokerClient client)
 {
     defaultClient = client;
 }
Exemplo n.º 24
0
 /* Adds a poker client to the list of supported clients */
 public static void Add(PokerClient client)
 {
     clientList.Add(client.Name, client);
 }
Exemplo n.º 25
0
 /* Loads the languages available for a specific client */
 private void LoadPokerClientLanguages(PokerClient client)
 {
     cmbPokerClientLanguage.DataSource = client.SupportedLanguages;
 }
Exemplo n.º 26
0
 /* Loads the languages available for a specific client */
 private void LoadPokerClientLanguages(PokerClient client)
 {
     cmbPokerClientLanguage.DataSource = client.SupportedLanguages;
 }
Exemplo n.º 27
0
        public void SetHandHistoryDirectoryFor(PokerClient client, String directory)
        {
            String key = client.XmlName + "_hand_history_directory";

            SetSetting(key, directory);
        }
Exemplo n.º 28
0
 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;
     }
 }
Exemplo n.º 29
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;
            }
        }