コード例 #1
0
ファイル: Table.cs プロジェクト: JGEsteves89/DaCMain
        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();
        }
コード例 #2
0
ファイル: Table.cs プロジェクト: JGEsteves89/DaCMain
        void handHistoryParser_FoundTableMaxSeatingCapacity(int maxSeatingCapacity)
        {
            this.maxSeatingCapacity = maxSeatingCapacity;

            // Usually the max seating capacity is the last piece of information we need in order to create a visual recognition manager

            // Attempt to create the visual recognition manager
            if (IsVisualRecognitionPossible()) {
                if (visualRecognitionManager == null) {
                    visualRecognitionManager = new VisualRecognitionManager(this, this);
                }

                // TODO REMOVE

                CardList cards = new CardList();
                //cards.AddCard(new Card(CardFace.Six, CardSuit.Spades));
                //cards.AddCard(new Card(CardFace.Eight, CardSuit.Spades));
                cards.AddCard(new Card(CardFace.Ace, CardSuit.Clubs));
                cards.AddCard(new Card(CardFace.Seven, CardSuit.Hearts));

                PlayerHandRecognized(cards);

                CardList board = new CardList();
                cards.AddCard(new Card(CardFace.Ace, CardSuit.Hearts));
                cards.AddCard(new Card(CardFace.Seven, CardSuit.Spades));
                cards.AddCard(new Card(CardFace.Six, CardSuit.Hearts));

                BoardRecognized(board);

                Globals.Director.RunFromGUIThread((Action)delegate () {
                    if (displayWindow != null) displayWindow.SetVisualRecognitionSupported(true);
                }, false);
            } else {
                Trace.WriteLine("Visual recognition is not supported for " + this.ToString());

                Globals.Director.RunFromGUIThread((Action)delegate () {
                    if (displayWindow != null) displayWindow.SetVisualRecognitionSupported(false);
                }, false);
            }
        }