예제 #1
0
        public static string AchievementsHTML(WOTStats stats)
        {
            string html = @"<table class='b-gray-text' width='100%'><tbody>";

            using (Achievements ach = new Achievements())
            {
                foreach (KeyValuePair <int, Achievement> item in ach.OrderBy(x => x.Key))
                {
                    int total     = 0;
                    int completed = 0;
                    foreach (string tank in item.Value.Tanks)
                    {
                        total += (from x in stats.tanks.Select(h => h.FragList.Where(f => f.CountryID + "_" + f.TankID == tank).Select(g => g.frags).Sum())
                                  select x).Sum();
                    }

                    while (total >= item.Value.Value)
                    {
                        total -= item.Value.Value;
                        completed++;
                    }
                    html += @"<tr><th class='th1' align='center' width=100% colspan='2'>" + item.Value.Name + @"</th></tr>
										   <tr><th class='th1' align='center' width=100% colspan='2'>"                                         + Translations.TranslationGet("STR_ACHIEVED", "DE", "Achieved: ") + completed + @"</th> </tr>";
                    html += @"<tr><td width=100%><table width=100%><tr><td align='center' width=" + Math.Round((decimal)total / (decimal)item.Value.Value * (decimal)100, 0) + "% bgColor=green><font><strong>" + (total == 0 ? "" : total.ToString()) + @"</strong></font></td>";
                    html += @"<td align='center' width=" + ((decimal)100 - Math.Round((decimal)total / (decimal)item.Value.Value * (decimal)100, 0)) + "% bgColor=red><font ><strong>" + ((item.Value.Value - total) == 0 ? "" : (item.Value.Value - total).ToString()) + @"</strong></font></td></tr></table></td></tr>";
                }
            }
            html += @"</tbody></table>";
            return(html);
        }
예제 #2
0
        private static string WN7_Tooltip(RatingStructure ratingStruct)
        {
            double damageFormula    = WN7_Damage(ratingStruct);
            double killFormula      = WN7_Frags(ratingStruct);
            double spottedFormula   = WN7_Spotted(ratingStruct);
            double winRateFormula   = WN7_WinRate(ratingStruct);
            double defenceFormula   = WN7_Defence(ratingStruct);
            double tierMalusFormula = WN7_TierMalus(ratingStruct);



            string total = FormatNumberToString(damageFormula + killFormula + spottedFormula + winRateFormula + defenceFormula + tierMalusFormula, 2);

            double[] valueArray = new double[] { damageFormula, killFormula, spottedFormula, winRateFormula, defenceFormula, tierMalusFormula };
            double   maxValue   = valueArray.Max();
            double   iTotal     = maxValue;

            List <string> i = new List <string>();

            string[] s = new string[7] {
                "", "Value", "WN7", "0", "0", "1", "H"
            };
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("STR_DAMAGE", "de", "Damage");
            s[1] = FormatNumberToString(ratingStruct.damageDealt, 0);
            s[2] = FormatNumberToString(damageFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((damageFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((damageFormula / iTotal)) * 100), 2);
            s[5] = "0";
            s[6] = "D";
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("HTML_CONT_KILLS", "de", "Kills");
            s[1] = FormatNumberToString(ratingStruct.frags, 0);
            s[2] = FormatNumberToString(killFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((killFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((killFormula / iTotal)) * 100), 2);
            s[5] = "0";

            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("HTML_CONT_DETECTED", "de", "Spotted");
            s[1] = FormatNumberToString(ratingStruct.spotted, 0);
            s[2] = FormatNumberToString(spottedFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((spottedFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((spottedFormula / iTotal)) * 100), 2);
            s[5] = "0";

            i.Add(string.Join("|", s));


            s[0] = Translations.TranslationGet("STR_DEFENCE", "de", "Defence");
            s[1] = FormatNumberToString(ratingStruct.defencePoints, 0);
            s[2] = FormatNumberToString(defenceFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((defenceFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((defenceFormula / iTotal)) * 100), 2);
            s[5] = "0";
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("STR_WINRATE", "de", "Win Percentage");
            // TODO: Added by BadButton 2014-06-25 - Added method for getting correct win rate used for calculation, to be chacked by Phalynx
            s[1] = FormatNumberToString(WN7_WinRateTooltipPrefix(ratingStruct), 0);
            s[2] = FormatNumberToString(winRateFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((winRateFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((winRateFormula / iTotal)) * 100), 2);
            s[5] = "0";
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("STR_TIERMALUS", "de", "Tier Malus");
            s[1] = FormatNumberToString(ratingStruct.tier, 0);
            s[2] = FormatNumberToString(tierMalusFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((tierMalusFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((tierMalusFormula / iTotal)) * 100), 2);
            s[5] = "0";
            i.Add(string.Join("|", s));


            s[0] = "Total";
            s[1] = "";
            s[2] = total;
            s[3] = "0";
            s[4] = "0";
            s[5] = "1";
            s[6] = "T";
            i.Add(string.Join("|", s));


            //RatingStorage rr = new RatingStorage(ratingStruct);

            return(string.Join(";", i));
        }
예제 #3
0
        private string TankInfo(Tank tank)
        {
            string html = @"  <Table class='b-gray-text' width=100%>
								<Thead>
									<tr>
										<td width=10%>"                                         + TankImageLarge(tank.CountryID, tank.TankID, tank.Tank_Description) + @"</td>" +
                          "<th width=80% align=center valign=middle><font size=" + (UserSettings.HTMLHeaderFont + 2) + @"px>(" + GetRoman(tank.Tier) + ") " + tank.Tank_Description + @"</font></th>
										<td class='"                                         + CountryFlagFill(tank.CountryID) + @"' width=10%>" + MasterBadgeImage(tank.Special.MarkOfMastery) + @"</td>
									</tr>
								</Thead>
								<Tbody>
								<Tbody>
								</Table>

							   <Table class='b-gray-text' width=100%>
								<Thead>
									<tr>
										<th width = 50% align=Center></th>
										<th width = 50% align=center></th>
									</tr>
								</Thead>
								<Tbody>
								  <tr>
										<td  class='td-1' valign=top>
											<table width=100%>
												<thead>
												</thead>
												<tbody>
													<tr>
														<td  class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_HEAD_BATTLES", "DE", "Battles") + @"</strong>
														</td>
														<td  class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.BattlesCount, 0) + @"
														</td>
													</tr>
													<tr>
														<td  class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_VICTORIES", "DE", "Victories") + @"</strong>
														</td>
														<td  class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.Victories, 0) + " (" + WOTHelper.FormatNumberToString(Math.Round(tank.Data.VictoryPercentage, 2), 2) + @"%)
														</td>
													</tr>
													<tr>
														<td  class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_DEFEATS", "DE", "Defeats") + @"</strong>
														</td>
														<td  class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.Defeats, 0) + " (" + WOTHelper.FormatNumberToString(Math.Round(tank.Data.LossesPercentage, 2), 2) + @"%)
														</td>
													</tr>
													<tr>
														<td  class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_DRAWS", "DE", "Draws") + @"</strong>
														</td>
														<td  class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.Draws, 0) + " (" + WOTHelper.FormatNumberToString(Math.Round(tank.Data.DrawsPercentage, 2), 2) + @"%)
														</td>
													</tr>
													<tr>
														<td  class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_SURVIVED", "DE", "Survived") + @"</strong>
														</td>
														<td  class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.Survived, 0) + " (" + WOTHelper.FormatNumberToString(Math.Round((double)tank.Data.SurvivedPercentage, 2), 2) + @"%)
														</td>
													</tr>
													<tr>
														<td  class='td-1' colspan=2>
															<table class='b-gray-text' width=100%>
																<thead/>
																	<tr>
																		<td  class='td-1' align=center>"                                                                         + Translations.TranslationGet("HTML_SHOTS", "DE", "Shots") + @"</td>
																		<td  class='td-1' align=center>"                                                                         + Translations.TranslationGet("HTML_HITS", "DE", "Hits") + @"</td>
																		<td  class='td-1' align=center>"                                                                         + Translations.TranslationGet("HTML_CONT_HITRATIO", "DE", "Accuracy") + @"</td>
																		<td  class='td-1' align=center>"                                                                         + Translations.TranslationGet("HTML_MAXKILLS", "DE", "Max Kills") + @"</td>
																		<td  class='td-1' align=center>"                                                                         + Translations.TranslationGet("HTML_COMP_KILLPERBATTLE", "DE", "Kills/Battles") + @"</td>
																		<td  class='td-1' align=center>"                                                                         + Translations.TranslationGet("HTML_COMP_KILLPERDEATH", "DE", "Kills/Deaths") + @"</td>
																	</tr>
																<tbody>
																	<tr>
																		<td  class='td-1' align=center>"                                                                         + WOTHelper.FormatNumberToString(tank.Data.Shots, 0) + @"</td>
																		<td  class='td-1' align=center>"                                                                         + WOTHelper.FormatNumberToString(tank.Data.Hits, 0) + @"</td>
																		<td  class='td-1' align=center>"                                                                         + WOTHelper.FormatNumberToString(Math.Round(tank.Data.Accuracy, 2), 2) + @" %</td>
																		<td class='td-1' align=Center>"                                                                         + WOTHelper.FormatNumberToString(tank.Data.MaxFrags, 0) + @"</td>
																		<td align=Center> "                                                                         + WOTHelper.FormatNumberToString(((double)tank.Data.Frags / (double)tank.Data.BattlesCount), 2) + @"
																		<td align=Center> "                                                                         + WOTHelper.FormatNumberToString(((double)tank.Data.Frags / ((double)tank.Data.BattlesCount - (double)tank.Data.Survived)), 2) + @"
																	</tr>
																</tbody>
															</table>
														</td>
													</tr>
												</tbody>
											</table>
										</td>
										<td  class='td-1' valign=top>
											<table class='b-gray-text' width=100%>
												<thead>
												</thead>
												<tbody>
												   <tr>
														<td  class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_EFFICIENCY", "DE", "Efficiency") + @"</strong>
														</td>
														<td class='td-1' align=center>
															<strong>"                                                             + "" + EfficiencyDescription(tank.RatingEff) + " - " + WOTHelper.FormatNumberToString(Math.Round(tank.RatingEff, 2), 2) + @"</strong>
														</td>
													</tr>
												   <tr>
														<td  class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("STR_BR_Caption", "DE", "Battle Rating") + @"</strong>
														</td>
														<td class='td-1' align=center>
															<strong>"                                                             + "" + EfficiencyDescription(tank.RatingBR) + " - " + WOTHelper.FormatNumberToString(Math.Round(tank.RatingBR, 2), 2) + @"</strong>
														</td>
													</tr>
												   <tr>
														<td  class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("STR_WN7_Caption", "DE", "WN7") + @"</strong>
														</td>
														<td class='td-1' align=center>
															<strong>"                                                             + "" + WN7ColorScaleDescription(tank.RatingWN7) + " - " + WOTHelper.FormatNumberToString(Math.Round(tank.RatingWN7, 5), 2) + @"</strong>
														</td>
													</tr>
												   <tr>
														<td  class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("STR_WN8_Caption", "DE", "WN8") + @"</strong>
														</td>
														<td class='td-1' align=center>
															<strong>"                                                             + "" + WN8ColorScaleDescription(tank.RatingWN8) + " - " + WOTHelper.FormatNumberToString(Math.Round(tank.RatingWN8, 2), 2) + @"</strong>
														</td>
													</tr>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_KILLS", "DE", "Kills") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.Frags, 0) + @"
														</td>
													</tr>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_DMGCAUSED", "DE", "Damage Caused") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.DamageDealt, 0) + @"
														</td>
													</tr>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_CAPPOINTS", "DE", "Capture Points") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.CapturePoints, 0) + @"
														</td>
													</tr>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_DEFPOINTS", "DE", "Defense Points") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.DefencePoints, 0) + @"
														</td>
													</tr>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_DETECTED", "DE", "Detected") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.Spotted, 0) + @"
														</td>
													</tr>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_BATTLETIME", "DE", "Battle Time") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + FormatBattleTime(tank.Data.BattleLifeTime_Friendly) + @"
														</td>
													</tr>
												</tbody>
											</table>                                        
										</td>
								  </tr> 
								  <tr>
										<td class='td-1' valign=top>
											<table class='b-gray-text' width=100%>
												<thead>
												</thead>
												<tbody>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_EXPER", "DE", "Experience") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.Xp, 0) + @"
														</td>
													</tr>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_COMP_MAXEXP", "DE", "Maximum Experience") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.MaxXp, 0) + @"
														</td>
													</tr>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_COMP_AVGEXP", "DE", "Average Experience") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString((tank.Data.Xp / (tank.Data.BattlesCount == 0 ? 1 : tank.Data.BattlesCount)), 2) + @"
														</td>
													</tr>
												</tbody>
											</table>
										</td>
										<td class='td-1' valign=top>
											<table class='b-gray-text' width=100%>
												<thead>
												</thead>
												<tbody>
												   <tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_DMGREC", "DE", "Damage Received") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.DamageReceived, 0) + @"
														</td>
													</tr>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_CONT_DMGRATIO", "DE", "Damage Ratio") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(tank.Data.DamageRatio, 2) + @"
														</td>
													</tr>
													<tr>
														<td class='td-1' align=center>    
															<strong>"                                                             + Translations.TranslationGet("HTML_COMP_AVGDAM", "DE", "Average Damage") + @"</strong>
														</td>
														<td class='td-1' align=center>
															"                                                             + WOTHelper.FormatNumberToString(Math.Round(tank.Data.AverageDamageDealt, 2), 2) + @"
														</td>
													</tr>
												</tbody>
											</table>                                        
										</td>
								  </tr>                                   
								<Tbody>
								</Table>

								 <Table class='b-gray-text' width=100%>
								<Thead>
									<tr>
										<th width = 5% align=center colspan=5>"                                         + Translations.TranslationGet("HTML_TANKINFO_KILLBCLASS", "DE", "Kills By Class (Combined Battle Modes)") + @"</th>
									</tr>
									<tr>
									   <td class='td-1' align=center>"                                     + Translations.TranslationGet("HTML_HEAD_VEHICLECLASS", "DE", "Vehicle Class") + @"</td>
									   <td class='td-1' align=center>"                                     + Translations.TranslationGet("HTML_CONT_KILLS", "DE", "Kills") + @"</td>
								   </tr>
								</Thead>
								<Tbody>"                                ;

            using (TankTypeDescription tankTypes = new TankTypeDescription(_message))
            {
                foreach (KeyValuePair <string, string> tankType in tankTypes)
                {
                    html += @"<tr>
                                                                <td><strong> "                                                 + tankType.Value + @"<strong>
                                                                <td class='td-1' align=center>"                                                 + tank.FragList.Where(a => a.TankClass == tankType.Key).Sum(y => y.frags) + @"<td>
                                                              </tr>"                                            ;
                }
            }

            html += @"<Tbody>
								</Table>

								<Table class='b-gray-text' width=100%>
								<Thead>
									<tr>
										<th align=center colspan=10>"                                         + Translations.TranslationGet("HTML_TANKINFO_KILLS", "DE", "Kills (Combined Battle Modes)") + @"</th>
									</tr>
								</Thead>
								<Tbody> "                                ;
            int x = 0;

            foreach (FragCount item in tank.FragList.OrderByDescending(y => y.Tier))
            {
                if (x == 0)
                {
                    html += "<tr>";
                }

                html += String.Format(@"<td class='" + CountryFlag(item.CountryID) + @" td-armory-icon'>
																		<div class='wrapper'>
																			<span class='level'><a class='b-gray-text'>"                                                                             + GetRoman(item.Tier) + @"</a></span>
																			<a>"                                                                             + TankImage(item.CountryID, item.TankID, item.Tank_Description) + @"</a>
																		</div>
																	</td>
																	<td valign=left>{0} : <strong>{1}</strong></td>"                                                                    , item.Tank_Description, item.frags);
                x++;

                if (x == 5)
                {
                    html += "</tr>";
                    x     = 0;
                }
            }

            html += @"<Tbody>
								</Table>"                                ;

            return(html);
        }
예제 #4
0
        private static string WN8_Tooltip(RatingStorage WN8)
            //string damageCaption, double damage, double damageFormula, string killCaption, double kill, double killFormula, string spottedCaption, double spotted, double spottedFormula, string Translations.TranslationGet("STR_DEFENCE", "de", "Defence"), double defence, double defenceFormula, string winRateCaption, double winRate, double winRateFormula)
        {
            
            
            //, WN8.damage, WN8.rDAMAGE, , WN8.frags, WN8.rFRAG, , WN8.spotted, WN8.rSPOT, , WN8.defence, WN8.rDEF, , WN8.winRate, WN8.rWIN
            string total = FormatNumberToString(WN8.Value, 2);
            double[] valueArray = new double[] { WN8.rDAMAGE, WN8.rFRAG, WN8.rSPOT, WN8.rDEF, WN8.rWIN };
            double maxValue = valueArray.Max();
            double iTotal = maxValue;

            List<string> i = new List<string>();
            string[] s = new string[8] { "", "Value", "Expected", "WN8", "0", "0", "1", "H" };
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("STR_DAMAGE", "de", "Damage");
            s[1] = FormatNumberToString(WN8.damage, 0);
            s[2] = FormatNumberToString(WN8.rDAMAGE, 0);
            s[3] = FormatNumberToString(WN8.expDAMAGE, 0);
            s[4] = FormatNumberToString(Math.Abs(((WN8.rDAMAGE / iTotal) - 1) * 100), 2);
            s[5] = FormatNumberToString(Math.Abs(((WN8.rDAMAGE / iTotal)) * 100), 2);
            s[6] = "0";
            s[7] = "D";
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("HTML_CONT_KILLS", "de", "Kills");
            s[1] = FormatNumberToString(WN8.frags, 1);
            s[2] = FormatNumberToString(WN8.rFRAG, 1);
            s[3] = FormatNumberToString(WN8.expFRAG, 1);
            s[4] = FormatNumberToString(Math.Abs(((WN8.rFRAG / iTotal) - 1) * 100), 2);
            s[5] = FormatNumberToString(Math.Abs(((WN8.rFRAG / iTotal)) * 100), 2);
            s[6] = "0";

            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("HTML_CONT_DETECTED", "de", "Detected");
            s[1] = FormatNumberToString(WN8.spotted, 1);
            s[2] = FormatNumberToString(WN8.rSPOT, 1);
            s[3] = FormatNumberToString(WN8.expSPOT, 1);
            s[4] = FormatNumberToString(Math.Abs(((WN8.rSPOT / iTotal) - 1) * 100), 2);
            s[5] = FormatNumberToString(Math.Abs(((WN8.rSPOT / iTotal)) * 100), 2);
            s[6] = "0";

            i.Add(string.Join("|", s));


            s[0] = Translations.TranslationGet("STR_DEFENCE", "de", "Defence");
            s[1] = FormatNumberToString(WN8.defence, 1);
            s[2] = FormatNumberToString(WN8.rDEF, 1);
            s[3] = FormatNumberToString(WN8.expDEF, 1);
            s[4] = FormatNumberToString(Math.Abs(((WN8.rDEF / iTotal) - 1) * 100), 2);
            s[5] = FormatNumberToString(Math.Abs(((WN8.rDEF / iTotal)) * 100), 2);
            s[6] = "0";
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("STR_WINRATE", "de", "Win Percentage");
            s[1] = FormatNumberToString(WN8.winRate, 1);
            s[2] = FormatNumberToString(WN8.rWIN, 1);
            s[3] = FormatNumberToString(WN8.expWIN, 1);
            s[4] = FormatNumberToString(Math.Abs(((WN8.rWIN / iTotal) - 1) * 100), 2);
            s[5] = FormatNumberToString(Math.Abs(((WN8.rWIN / iTotal)) * 100), 2);
            s[6] = "0";
            i.Add(string.Join("|", s));

            s[0] = "Total";
            s[1] = "";
            s[2] = total;
            s[3] = "";
            s[4] = "0";
            s[5] = "0";
            s[6] = "1";
            s[7] = "T";
            i.Add(string.Join("|", s));
//WOTHelper.AddToLog (string.Join(";", i));
            return string.Join(";", i);
        }
예제 #5
0
        private static string BR_Tooltip(RatingStructure ratingStruct)
        {
            double damageFormula               = BR_Damage(ratingStruct);
            double killFormula                 = BR_Kills(ratingStruct);
            double spottedFormula              = BR_Spotted(ratingStruct);
            double captureFormula              = BR_Captured(ratingStruct);
            double defenceFormula              = BR_Defence(ratingStruct);
            double damageAssistedRadioFormula  = BR_DamageAssistedRadio(ratingStruct);
            double damageAssistedTracksFormula = BR_DamageAssistedTrack(ratingStruct);


            string total = FormatNumberToString(damageFormula + killFormula + spottedFormula + captureFormula + defenceFormula + damageAssistedRadioFormula + damageAssistedTracksFormula, 2);

            double[] valueArray = new double[] { damageFormula, killFormula, spottedFormula, captureFormula, defenceFormula, damageAssistedRadioFormula, damageAssistedTracksFormula };
            double   maxValue   = valueArray.Max();
            double   iTotal     = maxValue;

            List <string> i = new List <string>();

            string[] s = new string[7] {
                "", "Value", "BR", "0", "0", "1", "H"
            };
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("STR_DAMAGE", "de", "Damage");
            s[1] = FormatNumberToString(ratingStruct.damageDealt, 0);
            s[2] = FormatNumberToString(damageFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((damageFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((damageFormula / iTotal)) * 100), 2);
            s[5] = "0";
            s[6] = "D";
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("STR_DAMAGE_ASSISTED_RADIO", "de", "Damage Assisted Radio");
            s[1] = FormatNumberToString(ratingStruct.damageAssistedRadio, 0);
            s[2] = FormatNumberToString(damageAssistedRadioFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((damageAssistedRadioFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((damageAssistedRadioFormula / iTotal)) * 100), 2);
            s[5] = "0";
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("STR_DAMAGE_ASSISTED_TRACK", "de", "Damage Assisted Track");
            s[1] = FormatNumberToString(ratingStruct.damageAssistedTracks, 0);
            s[2] = FormatNumberToString(damageAssistedTracksFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((damageAssistedTracksFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((damageAssistedTracksFormula / iTotal)) * 100), 2);
            s[5] = "0";
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("HTML_CONT_KILLS", "de", "Kills");
            s[1] = FormatNumberToString(ratingStruct.frags, 0);
            s[2] = FormatNumberToString(killFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((killFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((killFormula / iTotal)) * 100), 2);
            s[5] = "0";

            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("HTML_CONT_DETECTED", "de", "Spotted");
            s[1] = FormatNumberToString(ratingStruct.spotted, 0);
            s[2] = FormatNumberToString(spottedFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((spottedFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((spottedFormula / iTotal)) * 100), 2);
            s[5] = "0";

            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("STR_CAPTURE", "de", "Capture");
            s[1] = FormatNumberToString(ratingStruct.capturePoints, 0);
            s[2] = FormatNumberToString(captureFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((captureFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((captureFormula / iTotal)) * 100), 2);
            s[5] = "0";
            i.Add(string.Join("|", s));

            s[0] = Translations.TranslationGet("STR_DEFENCE", "de", "Defence");
            s[1] = FormatNumberToString(ratingStruct.defencePoints, 0);
            s[2] = FormatNumberToString(defenceFormula, 2);
            s[3] = FormatNumberToString(Math.Abs(((defenceFormula / iTotal) - 1) * 100), 2);
            s[4] = FormatNumberToString(Math.Abs(((defenceFormula / iTotal)) * 100), 2);
            s[5] = "0";
            i.Add(string.Join("|", s));



            s[0] = "Total";
            s[1] = "";
            s[2] = total;
            s[3] = "0";
            s[4] = "0";
            s[5] = "1";
            s[6] = "T";
            i.Add(string.Join("|", s));

            return(string.Join(";", i));
        }