public CustomGroupings(MessageQueue message, string groupName) { InitializeComponent(); _message = message; _tDescription = new TankDescriptions(_message); _cDescription = new CountryDescriptions(_message); _typeDescription = new TankTypeDescription(_message); _customGrouping = new CustomGrouping(_message); _ID = groupName.Replace(" ", "_"); txtGroupName.Text = _customGrouping.Description(_ID); ListViewSettings(); }
public CustomGroupings(MessageQueue message) { InitializeComponent(); _message = message; _tDescription = new TankDescriptions(_message); _cDescription = new CountryDescriptions(_message); _typeDescription = new TankTypeDescription(_message); _ID = ""; ListViewSettings(); }
public GraphSetup(MessageQueue message, string graphID) { InitializeComponent(); _message = message; _ID = graphID; //textName.Text = graphName; //textName.Enabled = false; _tDescription = new TankDescriptions(_message); _cDescription = new CountryDescriptions(_message); _typeDescription = new TankTypeDescription(_message); _graphSettings = new GraphsSettings(_message); ListViewSettings(); LoadSettings(); }
public GraphSetup(MessageQueue message) { InitializeComponent(); _message = message; _tDescription = new TankDescriptions(_message); _cDescription = new CountryDescriptions(_message); _typeDescription = new TankTypeDescription(_message); _graphSettings = new GraphsSettings(_message); helpProvider1.HelpNamespace = Path.Combine(WOTHelper.GetEXEPath(), "Help", "WoT_Stats.chm"); helpProvider1.SetHelpNavigator(this, HelpNavigator.TopicId); helpProvider1.SetHelpKeyword(this, "520"); ListViewSettings(); LoadSettings(); }
private string CountryStats(WOTStats stats, WOTStats prevStats, WOTStatsDelta delta) { CountryDescriptions countries = new CountryDescriptions(_message); string html = @"<table class=o width=100%> <thead> </thead> <tbody> <tr> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_COUNTRY", "DE", "Country") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_BATTLES", "DE", "Battles") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_DELTA", "DE", "Delta") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_CONT_VICTORIES", "DE", "Victories") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_DELTA", "DE", "Delta") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_CONT_DEFEATS", "DE", "Defeats") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_DELTA", "DE", "Delta") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_CONT_DRAWS", "DE", "Draws") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_DELTA", "DE", "Delta") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_LASTPLAY", "DE", "Last Played") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_CONT_KILLS", "DE", "Kills") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_DELTA", "DE", "Delta") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_CONT_DMGCAUSED", "DE", "Damage Caused") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_DELTA", "DE", "Delta") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_CONT_DMGREC", "DE", "Damage Received") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_DELTA", "DE", "Delta") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("STR_WN7_Caption", "DE", "WN7") + @"</strong></th> <th align=center><strong>" + Translations.TranslationGet("HTML_HEAD_DELTA", "DE", "Delta") + @"</strong></th> </tr>"; foreach (KeyValuePair<int, string> country in countries) { double tier = 0; for (int i = 1; i <= 10; i++) { double var = (from x in stats.tanks where x.Tier == i && x.CountryID == country.Key select x.Data.BattlesCount).Sum() * i; tier += var; } double frags = (from x in stats.tanks where x.CountryID == country.Key select x.Data.Frags).Sum(); double victories = (from x in stats.tanks where x.CountryID == country.Key select x.Data.Victories).Sum(); double defeats = (from x in stats.tanks where x.CountryID == country.Key select x.Data.Defeats).Sum(); double draws = (from x in stats.tanks where x.CountryID == country.Key select x.Data.Draws).Sum(); double damage = (from x in stats.tanks where x.CountryID == country.Key select x.Data.DamageDealt).Sum(); double damageAssistedRadio = (from x in stats.tanks where x.CountryID == country.Key select x.Data.DamageAssistedRadio).Sum(); double damageAssistedTrack = (from x in stats.tanks where x.CountryID == country.Key select x.Data.DamageAssistedTracks).Sum(); double damageReceived = (from x in stats.tanks where x.CountryID == country.Key select x.Data.DamageReceived).Sum(); double spotted = (from x in stats.tanks where x.CountryID == country.Key select x.Data.Spotted).Sum(); double defence = (from x in stats.tanks where x.CountryID == country.Key select x.Data.DefencePoints).Sum(); double capture = (from x in stats.tanks where x.CountryID == country.Key select x.Data.CapturePoints).Sum(); double battles = (from x in stats.tanks where x.CountryID == country.Key select x.Data.BattlesCount).Sum(); //double efficiency = (frags * (350.0 - (Math.Round(tier / battles, 2)) * 20.0) + damage * (0.2 + 1.5 / (Math.Round(tier / battles, 2))) + 200.0 * spotted + 150.0 * defence + 150.0 * capture) / battles; //double efficiency = ((damage / battles) * (10 / (Math.Round(tier / battles, 2) + 2)) * (0.23 + 2 * Math.Round(tier / battles, 2) / 100)) + ((frags / battles) * 250) + ((spotted / battles) * 150) + ((Math.Log((capture / battles) + 1, 1.732)) * 150) + ((defence / battles) * 150); RatingStructure ratingStruct = new RatingStructure(); ratingStruct.WN8ExpectedTankList = WN8ExpectedTankList; ratingStruct.countryID = -1; ratingStruct.tankID = -1; ratingStruct.tier = tier; ratingStruct.globalTier = tier; ratingStruct.singleTank = true; ratingStruct.battlesCount = Convert.ToInt32(battles); ratingStruct.battlesCount8_8 = 0; ratingStruct.capturePoints = capture; ratingStruct.defencePoints = defence; ratingStruct.damageAssistedRadio = 0; ratingStruct.damageAssistedTracks = 0; ratingStruct.damageDealt = damage; ratingStruct.frags = frags; ratingStruct.spotted = spotted; ratingStruct.wins = victories; ratingStruct.gWinRate = ratingStruct.winRate; double RatingWN7 = WOTStatistics.Core.Ratings.GetRatingWN7(ratingStruct).Value; //double delTier = 0; //for (int i = 1; i <= 10; i++) //{ //double delVar = (from x in delta.tanks // where x.Tier == i && x.CountryID == country.Key // select x.Data.BattlesCount).Sum() * i; //delTier += delVar; //} //double delFrags = (from x in delta.tanks // where x.CountryID == country.Key // select x.Data.Frags).Sum(); //double delDamage = (from x in delta.tanks // where x.CountryID == country.Key // select x.Data.DamageDealt).Sum(); //double delSpotted = (from x in delta.tanks // where x.CountryID == country.Key // select x.Data.Spotted).Sum(); //double delDefence = (from x in delta.tanks // where x.CountryID == country.Key // select x.Data.DefencePoints).Sum(); //double delCapture = (from x in delta.tanks // where x.CountryID == country.Key // select x.Data.CapturePoints).Sum(); //double delBattles = (from x in delta.tanks // where x.CountryID == country.Key // select x.Data.BattlesCount).Sum(); double prevTier = 0; for (int i = 1; i <= 10; i++) { double prevVar = (from x in prevStats.tanks where x.Tier == i && x.CountryID == country.Key select x.Data.BattlesCount).Sum() * i; prevTier += prevVar; } double prevFrags = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.Frags).Sum(); double prevVictories = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.Victories).Sum(); double prevDefeats = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.Defeats).Sum(); double prevDraws = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.Draws).Sum(); double prevDamage = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.DamageDealt).Sum(); double prevDamageAssistedRadio = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.DamageAssistedRadio).Sum(); double prevDamageAssistedTrack = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.DamageAssistedTracks).Sum(); double prevDamageReceived = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.DamageReceived).Sum(); double prevSpotted = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.Spotted).Sum(); double prevDefence = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.DefencePoints).Sum(); double prevCapture = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.CapturePoints).Sum(); double prevBattles = (from x in prevStats.tanks where x.CountryID == country.Key select x.Data.BattlesCount).Sum(); // double delEfficiency = ((frags - delFrags) * (350.0 - (Math.Round((tier - delTier) / (battles - delBattles), 2)) * 20.0) + (damage - delDamage) * (0.2 + 1.5 / (Math.Round((tier - delTier) / (battles - delBattles), 2))) + 200.0 * (spotted - delSpotted) + 150.0 * (defence - delDefence) + 150.0 * (capture - delCapture)) / (battles - delBattles); //double delEfficiency = ((prevDamage / prevBattles) * (10 / (Math.Round(prevTier / prevBattles, 2) + 2)) * (0.23 + 2 * Math.Round(prevTier / prevBattles, 2) / 100)) + ((prevFrags / prevBattles) * 250) + ((prevSpotted / prevBattles) * 150) + ((Math.Log((prevCapture / prevBattles) + 1, 1.732)) * 150) + ((prevDefence / prevBattles) * 150); ratingStruct = new RatingStructure(); ratingStruct.WN8ExpectedTankList = WN8ExpectedTankList; ratingStruct.countryID = -1; ratingStruct.tankID = -1; ratingStruct.tier = tier; ratingStruct.globalTier = tier; ratingStruct.singleTank = true; ratingStruct.battlesCount = Convert.ToInt32(prevBattles); ratingStruct.battlesCount8_8 = 0; ratingStruct.capturePoints = prevCapture; ratingStruct.defencePoints = prevDefence; ratingStruct.damageAssistedRadio = 0; ratingStruct.damageAssistedTracks = 0; ratingStruct.damageDealt = prevDamage; ratingStruct.frags = prevFrags; ratingStruct.spotted = prevSpotted; ratingStruct.wins = prevVictories; ratingStruct.gWinRate = ratingStruct.winRate; double prevRatingWN7 = WOTStatistics.Core.Ratings.GetRatingWN7(ratingStruct).Value; html += @" <tr> <td class='" + CountryFlag(country.Key) + @" td-armory-icon'> <div class='wrapper'> <span class='MiddleCenter'><a class='b-gray-text'>" + country.Value + @"</a></span> </div> </td> <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(battles, 0) + @"</td> <td class='td-1' align=right>" + GetDelta(battles - prevBattles, "", 0) + @"</td> <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(victories, 0) + @"</td> <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(victories - prevVictories, 0) + @" <span style='white-space: nowrap;'>(" + GetDelta(Math.Round((victories / battles * 100) - (prevVictories / prevBattles * 100), 2), "%", 2) + ")</span>" + @"</td> <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(defeats, 0) + @"</td> <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(defeats - prevDefeats, 0) + @" <span style='white-space: nowrap;'>(" + GetDelta(Math.Round((defeats / battles * 100) - (prevDefeats / prevBattles * 100), 2), "%", 2, true) + ")</span>" + @"</td> <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(draws, 0) + @"</td> <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(draws - prevDraws, 0) + @" <span style='white-space: nowrap;'>(" + GetDelta(Math.Round((draws / battles * 100) - (prevDraws / prevBattles * 100), 2), "%", 2, true) + ")</span>" + "</td>"; try { html += @"<td class='td-1' align=right>" + stats.tanks.Where(x => x.CountryID == country.Key).Max(y => y.Updated_Friendly).ToString(UserSettings.DateFormat + (UserSettings.TimeStamp ? " " + UserSettings.TimeFormat : "")) + "</td>"; } catch { html += @"<td class='td-1' align=right> </td>"; } html += @" <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(frags, 0) + @"</td> <td class='td-1' align=right>" + GetDelta(Math.Round(frags - prevFrags, 2), "", 0) + @"</td> <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(damage, 0) + @"</td> <td class='td-1' align=right>" + GetDelta(Math.Round(damage - prevDamage, 2), "", 0) + @"</td> <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(damageReceived, 0) + @"</td> <td class='td-1' align=right>" + GetDelta(Math.Round(damageReceived - prevDamageReceived, 2), "", 0) + @"</td> <td class='td-1' align=right>" + WOTHelper.FormatNumberToString(Math.Round(RatingWN7, 2), 2) + @"</td> <td class='td-1' align=right>" + GetDelta(Math.Round(RatingWN7, 2) - Math.Round(prevRatingWN7, 2), "", 2) + @"</td> </tr>"; } html += @"</tbody> </table>"; return html; }