private void GetContentTimer(string title, string className, Tournament tournament, decimal sb, decimal bb, out string value, out bool visibility) { if (!Config.HudTimerShowHandCount) { int pokerTypeErrors = -1; if (PokerType == null) { PokerType = App.PokerTypeManager.GetPokerType(title, className, out pokerTypeErrors); if (pokerTypeErrors != 0) { PokerType = null; } } if (PokerType != null) { DateTime dateTimeUtcNow = DateTime.UtcNow.AddSeconds(-Config.HudTimerDiff); DateTime dateTimeUtcNextLevel = tournament.GetFirstHandTimestampET(); while (dateTimeUtcNextLevel < dateTimeUtcNow) { dateTimeUtcNextLevel = dateTimeUtcNextLevel + PokerType.LevelLength; } TimeSpan timeSpan = dateTimeUtcNextLevel - dateTimeUtcNow; value = string.Format("{0:00}:{1:00}", timeSpan.Minutes, timeSpan.Seconds); } else { if (pokerTypeErrors == 1) { value = Config.HudTimerPokerTypeNotFound; } else if (pokerTypeErrors == 2) { value = Config.HudTimerMultiplePokerTypes; } else { value = string.Format("Unknown Error"); } } } else { value = string.Format("{0}", tournament.CountLevelHands(sb, bb) + 1); } visibility = true; }
private void GetContentBigBlind(Tournament tournament, decimal sb, decimal bb, decimal ante, out decimal[] value, out bool[] visibility, out bool[] isHero, out string[] tooltip) { value = new decimal[10]; visibility = new bool[10]; isHero = new bool[10]; tooltip = new string[10]; var playerNames = tournament.GetLastHandHudPlayerNames(); var stacks = tournament.GetLastHandHudPlayerStacks(); var heroSeat = tournament.GetLastHandHudHeroSeat(); var tableSize = tournament.GetLastHandTableSize(); var playersAlive = stacks.Count(a => a > 0); int playerCount = playersAlive; if (Config.HudBigBlindMByPlayerCount) playerCount = playersAlive; if (Config.HudBigBlindMByTableSize) playerCount = (int)tableSize; for (int i = 0; i < stacks.Length; i++) { var mappedSeat = MapToPreferredSeat(TableSize, heroSeat, i); visibility[mappedSeat] = stacks[i] > 0; isHero[mappedSeat] = i == heroSeat; tooltip[mappedSeat] = playerNames[i]; if (Config.HudBigBlindShowBB) { value[mappedSeat] = stacks[i] / bb; tooltip[mappedSeat] = string.Format("{0}\r\n{1:0.0} = {2} / {3}", playerNames[i], value[mappedSeat], stacks[i], bb); } else if (Config.HudBigBlindShowAdjustedBB) { // Adjusted BB = stack / (2/3 * (SB + BB + (Ante * number of players))) value[mappedSeat] = stacks[i] / ((decimal)(2.0 / 3.0) * (sb + bb + (ante * playerCount))); tooltip[mappedSeat] = string.Format("{0}\r\n{1:0.0} = {2} / ((2 / 3) * ({3} + {4} + ({5} * {6})))", playerNames[i], value[mappedSeat], stacks[i], sb, bb, ante, playerCount); } else if (Config.HudBigBlindShowTournamentM) { // Tournament M = stack / (SB + BB + (Ante * number of players)) value[mappedSeat] = stacks[i] / (sb + bb + (ante * playerCount)); tooltip[mappedSeat] = string.Format("{0}\r\n{1:0.0} = {2} / ({3} + {4} + ({5} * {6}))", playerNames[i], value[mappedSeat], stacks[i], sb, bb, ante, playerCount); } } }