Beispiel #1
0
        /// <summary>
        /// Zero the data on shown on the DataDisplayForm.
        /// </summary>
        public void ZeroData()
        {
            // start data processing timers
            dataUpdateStpOthers.Start();

            ChartDataInvalid();

            // Zero the data for the 9 players at the table
            for (int i = 0; i < 9; i++)
            {
                int chartSetIndex = PlayerIndexToChartSetIndex(i);

                playerNameLbl[chartSetIndex].Text = "Player " + (i + 1).ToString();
                playerActionData[i] = new DataCounter();
                dataAnalyzers[i].PlotChartSet(playerActionData[i].Preflop, pieChts[chartSetIndex], chartNoDataLbl[chartSetIndex],
                                              chartSampleCountLbl[chartSetIndex], isChartUpToDate[chartSetIndex]);

                UpdateChartColors(chartSetIndex, false);
            }

            // Zero the data for the summation of the other players at the table
            playerNameLbl[9].Text = "Other Players at This Table";
            playerActionData[9]   = new DataCounter();
            dataAnalyzers[9].PlotChartSet(playerActionData[9].Preflop, pieChts[9], chartNoDataLbl[9], chartSampleCountLbl[9], isChartUpToDate[9]);

            // Update time stamp
            timeLbl.Text = DateTime.Now.ToString("hh:mm:ss tt");

            // Update data processing timer
            dataUpdateStpOthers.Stop();
            processingTimeOthersLbl.Text        = "Others: " + (dataUpdateStpOthers.ElapsedMilliseconds / 1000.0).ToString("f3") + " sec.";
            processingTimePlrOfInterestLbl.Text = plrOfInterestName + ": " + (dataUpdateStpOthers.ElapsedMilliseconds / 1000.0).ToString("f3") + " sec.";
            dataUpdateStpOthers.Reset();
        }
Beispiel #2
0
        /// <summary>
        /// The load event for the DataDisplayForm.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DataDisplayForm_Load(object sender, EventArgs e)
        {
            // Setup the controls for this form
            SetupDataDisplayForm SetupDataDisplayForm_ = new SetupDataDisplayForm(this);

            SetupDataDisplayForm_.SetFormColors(ref foldClr, ref checkClr, ref callClr, ref betClr,
                                                ref foldClrFaded, ref checkClrFaded, ref callClrFaded, ref betClrFaded,
                                                ref whiteClrFaded, rtbBackgroundClr);
            SetupDataDisplayForm_.InitializeForm();
            SetupDataDisplayForm_.InitializeFormPanels(ref dataPnl, ref legendFoldClrPnl, ref legendCheckClrPnl, ref legendCallClrPnl,
                                                       ref legendBetClrPnl, ref dataUpdateStatusIndicator, ref dataUpdateStatusIndicatorBorder);
            SetupDataDisplayForm_.InitializeFormLabels(ref formTitleLbl, ref timeLbl, ref legendFoldLbl, ref legendCheckLbl,
                                                       ref legendCallLbl, ref legendBetLbl, ref processingTimeOthersLbl, ref processingTimePlrOfInterestLbl,
                                                       ref playerNameLbl, ref chartNoDataLbl, ref chartSampleCountLbl);
            SetupDataDisplayForm_.InitializeFormButtons(ref preFlopBtn, ref flopBtn, ref turnBtn, ref riverBtn);
            SetupDataDisplayForm_.InitializeFormCharts(ref pieChts, ref isChartUpToDate);
            SetupDataDisplayForm_.SetControlSizesAndLocations();

            DisplayPreFlopData();

            dataUpdateStpOthers        = new Stopwatch();
            dataUpdateStpPlrOfInterest = new Stopwatch();

            dataAnalyzers    = new DataAnalyzer[10];
            playerActionData = new DataCounter[10];

            for (int i = 0; i < 10; i++)
            {
                dataAnalyzers[i]    = new DataAnalyzer();
                playerActionData[i] = new DataCounter();
            }

            // only 9 tasks (assuming a 9 player table)
            updateDataTasks = new Task[9];
        }
Beispiel #3
0
        /// <summary>
        /// Create the tasks for updating the player data on the Data Display Form. (One task for each of a possible 9 players)
        /// </summary>
        private void CreateUpdateDataTasks(List <DbPlayerHandInfoAll>[] playersDbDataToAnalyze)
        {
            for (int i = 0; i < 9; i++)
            {
                int j = i;
                if (updateDataTasks[j] == null || updateDataTasks[j].Status != TaskStatus.Created)
                {
                    updateDataTasks[j] = new Task(() =>
                    {
                        // If this is an open seat don't update the data -> pass an empty cntPlayerData object
                        // Note: If the player is sitting out continue to process data as if he is playing. Things get messed up and
                        //       too complicated when trying to ignore players sitting out, not worth the effort.
                        // Note: intBoardStatus_tsk determines what betting stage we are in (0 = preflop, 1 = flop, 2 = turn, 3 = river)
                        if (isOpenSeat_tsk[j])
                        {
                            playerActionData[j] = new DataCounter();
                        }
                        else
                        {
                            playerActionData[j] = dataAnalyzers[j].AnalyzePlayerData(playersDbDataToAnalyze[j], dbGameId_tsk, currNumPlayers_tsk, plrOfInterestDbHandPlayerId);
                        }

                        // Debug.WriteLine("Completing task #" + j.ToString() + " - " + playerNames_tsk[j].ToString());
                    });
                }
            }
        }
Beispiel #4
0
 public void AddCounters(DataCounter newcounter)
 {
     DataCounters.Add(newcounter);
 }
Beispiel #5
0
 public Enemy()
 {
     DataCounter.AddCounters(new StatusCounter());
 }
Beispiel #6
0
 public Player()
 {
     DataCounter.AddCounters(new StatusCounter());
 }