Ejemplo n.º 1
0
 public void UpdateDataControls(CurrentGameData currentGameData)
 {
     lblPlayersLeftVal.Text = currentGameData.PlayersLeft.ToString();
     lblTotalChipsVal.Text  = currentGameData.TotalChips.ToString();
     lblAvgStackVal.Text    = currentGameData.AverageStack.ToString();
     lblTime.Text           = currentGameData.GetMinutes().ToString("D2") + ":" + currentGameData.GetSeconds().ToString("D2");
     lblRound.Text          = "Round " + currentGameData.Round;
     lblBlinds.Text         = currentGameData.GetBlinds();
     lblNextBlinds.Text     = currentGameData.GetNextBlinds();
     lblPotVal.Text         = "$" + currentGameData.Pot;
     lblFirstVal.Text       = "$" + currentGameData.GetPayouts()[0];
     lblSecondVal.Text      = "$" + currentGameData.GetPayouts()[1];
     lblThirdVal.Text       = "$" + currentGameData.GetPayouts()[2];
     lblFourthVal.Text      = "$" + currentGameData.GetPayouts()[3];
 }
Ejemplo n.º 2
0
        private void UpdateLastGameStats(List <PlayerData> sortedList)
        {
            List <List <string> > valueList = new List <List <string> >();
            string date = "";

            foreach (PlayerData data in sortedList)
            {
                string place  = data.Place.ToString();
                string name   = data.Name;
                double spent  = (data.Rebuys * 10 + 10);
                double won    = 0;
                double net    = 0;
                string rebuys = data.Rebuys.ToString();
                double points = Math.Max(sortedList.Count() - data.Place + 1 - (data.Rebuys * 0.5), 0);

                if (data.Place <= 4)
                {
                    won = currentGameData.GetPayouts()[data.Place - 1];
                }

                net = won - spent;


                valueList.Add(new List <string> {
                    place, name, spent.ToString(), won.ToString(), net.ToString(), rebuys, points.ToString()
                });
            }

            while (valueList.Count <= Int32.Parse(settings[Settings.Default.IniSection]["MaximumPlayers"]) - sortedList.Count)
            {
                valueList.Add(new List <string> {
                    "", "", "", "", "", "", ""
                });
            }

            UpdateGoogleSpreadsheetCellRange("1pgtVGwY1ba3BxL5p5HwS_aYpDj1Go_Y1UPgam9S57Ac", "'" + settings[Settings.Default.IniSection]["GameLocation"].ToUpper() + " Last Game'!C7:I20", valueList);

            if (DateTime.Today.Hour < 2)
            {
                date = DateTime.Today.ToString("MMMM") + " " + DateTime.Today.Date.Day.ToString() + GetDaySuffix(DateTime.Today.Date.Day);
            }
            else
            {
                date = DateTime.Today.ToString("MMMM") + " " + (DateTime.Today.Date.Day - 1).ToString() + GetDaySuffix(DateTime.Today.Date.Day);
            }

            date = "Results for " + date;

            UpdateGoogleSpreadsheetCell("1pgtVGwY1ba3BxL5p5HwS_aYpDj1Go_Y1UPgam9S57Ac", "'" + settings[Settings.Default.IniSection]["GameLocation"].ToUpper() + " Last Game'!C3", date);
        }