public override void PrintTankStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stats = SelectStatsToPrint(statisticTypeToPrint); if (stats.TankAttempts == 0) { return; } conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" пнуть:", TextColor.BrightRed), new TextMessageBlock("\t Средний: ", TextColor.White), new TextMessageBlock(((double)stats.TotalTankDamage / (stats.SuccessTankAttempts > 0?stats.SuccessTankAttempts:1)).ToString("P"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stats.MaxTankDamage.ToString(), TextColor.BrightWhite), new TextMessageBlock("\t Шанс: ", TextColor.White), new TextMessageBlock(((double)stats.SuccessTankAttempts / stats.TankAttempts).ToString("P"), TextColor.BrightWhite), })); conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock("\t\t Шанс сбить: ", TextColor.White), new TextMessageBlock(((double)stats.BashTankAttempts / (stats.SuccessTankAttempts > 0 ? stats.SuccessTankAttempts: 1)).ToString("P"), TextColor.BrightWhite), new TextMessageBlock("\t Шанс упасть: ", TextColor.White), new TextMessageBlock(((double)stats.FallTankAttempts / (stats.TankAttempts - stats.SuccessTankAttempts > 0 ? stats.TankAttempts - stats.SuccessTankAttempts: 1)).ToString("P"), TextColor.BrightWhite), })); }
public override void PrintDamageStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stat = SelectStatsToPrint(statisticTypeToPrint); if (stat.TotalAttempts == 0) { return; } //for nice printing if (_skillName.Length < 4) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock($" {_skillName}: ", TextColor.BrightYellow), new TextMessageBlock("\t Средний: ", TextColor.White), new TextMessageBlock(((double)stat.TotalDamage / stat.TotalAttempts).ToString("00.00"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stat.MaxDamage.ToString(), TextColor.BrightWhite), })); } else { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock($" {_skillName}:", TextColor.BrightYellow), new TextMessageBlock("\t Средний: ", TextColor.White), new TextMessageBlock(((double)stat.TotalDamage / stat.TotalAttempts).ToString("00.00"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stat.MaxDamage.ToString(), TextColor.BrightWhite), })); } }
public override void PrintDamageStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stats = SelectStatsToPrint(statisticTypeToPrint); if (stats.TotalAttempts == 0 || stats.SuccessAttempts == 0) { return; } conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" заколоть:", TextColor.BrightYellow), new TextMessageBlock("\t Средний: ", TextColor.White), new TextMessageBlock(((double)stats.TotalDamage / stats.SuccessAttempts).ToString("00.00"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stats.MaxDamage.ToString(), TextColor.BrightWhite), new TextMessageBlock("\t Шанс: ", TextColor.White), new TextMessageBlock(((double)stats.SuccessAttempts / stats.TotalAttempts).ToString("P"), TextColor.BrightWhite), })); conveyor.PushMessage(new OutputToMainWindowMessage(new [] { new TextMessageBlock("\t\t Шанс отравить: ", TextColor.White), new TextMessageBlock(((double)stats.PoisonAttempts / stats.SuccessAttempts).ToString("P"), TextColor.BrightWhite), })); }
/// <summary> /// Pushes the message to conveyor. /// </summary> /// <param name="message">The message.</param> public void PushMessageToConveyor([NotNull] Message message) { Assert.ArgumentNotNull(message, "message"); if (_conveyor != null) { _conveyor.PushMessage(message); } }
public void PrintStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { if (statisticTypeToPrint == StatisticTypes.Session) { conveyor.PushMessage(new OutputToMainWindowMessage("Статистика за текущую сессию:", TextColor.BrightWhite)); PrintStatistics(conveyor, _sessionStats, statisticTypeToPrint); } if (statisticTypeToPrint == StatisticTypes.Zone) { conveyor.PushMessage(new OutputToMainWindowMessage("Статистика за последнюю зону:", TextColor.BrightWhite)); PrintStatistics(conveyor, _zoneStats, statisticTypeToPrint); } if (statisticTypeToPrint == StatisticTypes.Fight) { conveyor.PushMessage(new OutputToMainWindowMessage("Статистика за последний бой:", TextColor.BrightWhite)); PrintStatistics(conveyor, _fightStats, statisticTypeToPrint); } }
public override void PrintTankStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stats = SelectStatsToPrint(statisticTypeToPrint); if (stats.TankAttempts == 0) { return; } conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" подножка:", TextColor.BrightRed), new TextMessageBlock("\t Шанс: ", TextColor.White), new TextMessageBlock(((double)stats.SuccessTankAttempts / stats.TankAttempts).ToString("P"), TextColor.BrightWhite), })); }
public override void PrintDamageStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stats = SelectStatsToPrint(statisticTypeToPrint); if (stats.Attempts == 0) { return; } conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" обезоруж.:", TextColor.BrightYellow), new TextMessageBlock("\t Шанс: ", TextColor.White), new TextMessageBlock(((double)stats.SuccessAttempts / stats.Attempts).ToString("P"), TextColor.BrightWhite) })); }
public override void PrintTankStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stats = SelectStatsToPrint(statisticTypeToPrint); if (stats.TotalTankAttempts == 0) { return; } conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" героич.:", TextColor.BrightRed), new TextMessageBlock("\t Средний: ", TextColor.White), new TextMessageBlock(((double)stats.TotalTankDamage / stats.TotalTankAttempts).ToString("P"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stats.MaxTankDamage.ToString(), TextColor.BrightWhite), })); }
private void PrintStatistics(MessageConveyor conveyor, DamageStats stat, StatisticTypes statisticTypeToPrint) { conveyor.PushMessage(new OutputToMainWindowMessage("Ваши повреждения:", TextColor.BrightYellow)); if (stat.TotalRounds > 0) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Дамаг в раунд средний: ", TextColor.White), new TextMessageBlock((stat.TotalDamage / stat.TotalRounds).ToString("00.00"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stat.MaxRoundDamage.ToString("00.00"), TextColor.BrightWhite), })); conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Дамаг cуммарный: ", TextColor.White), new TextMessageBlock(stat.TotalDamage.ToString(CultureInfo.InvariantCulture), TextColor.BrightWhite), })); } if (stat.TotalDamageMessages > 0) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Крит шанс: ", TextColor.White), new TextMessageBlock(((double)stat.TotalCritDamageMessages / stat.TotalDamageMessages).ToString("P"), TextColor.BrightWhite), })); } if (stat.TotalCasts > 0) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Шанс фейл каста: ", TextColor.White), new TextMessageBlock(((double)stat.FailedCasts / stat.TotalCasts).ToString("P"), TextColor.BrightWhite), })); } if (stat.StunRounds > 0 && stat.TotalRounds > 0) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Шанс оглушить: ", TextColor.White), new TextMessageBlock(((double)stat.StunRounds / stat.TotalRounds).ToString("P"), TextColor.BrightWhite), })); } conveyor.PushMessage(new OutputToMainWindowMessage("Умения/заклинания:", TextColor.BrightYellow)); foreach (var damageSkill in _damageSkills) { damageSkill.PrintDamageStatistics(conveyor, statisticTypeToPrint); } conveyor.PushMessage(new OutputToMainWindowMessage("Повреждения по вам:", TextColor.BrightRed)); if (stat.TotalTankRounds > 0) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Дамаг в раунд средний: ", TextColor.White), new TextMessageBlock((stat.TotalTankDamage / stat.TotalTankRounds).ToString("00.00"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stat.MaxTankRoundDamage.ToString("00.00"), TextColor.BrightWhite), })); conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Дамаг cуммарный: ", TextColor.White), new TextMessageBlock(stat.TotalTankDamage.ToString(CultureInfo.InvariantCulture), TextColor.BrightWhite), })); } conveyor.PushMessage(new OutputToMainWindowMessage("Умения/заклинания:", TextColor.BrightRed)); foreach (var damageSkill in _damageSkills) { damageSkill.PrintTankStatistics(conveyor, statisticTypeToPrint); } var expMessages = new List <TextMessageBlock>(); if (stat.TotalExp > 0) { expMessages.Add(new TextMessageBlock("Опыт: ", TextColor.White)); expMessages.Add(new TextMessageBlock(stat.TotalExp.ToString(CultureInfo.InvariantCulture), TextColor.BrightWhite)); expMessages.Add(new TextMessageBlock("\t", TextColor.White)); } if (stat.TotalSlava > 0) { expMessages.Add(new TextMessageBlock("Слава: ", TextColor.White)); expMessages.Add(new TextMessageBlock(stat.TotalSlava.ToString(CultureInfo.InvariantCulture), TextColor.BrightWhite)); } if (expMessages.Any()) { conveyor.PushMessage(new OutputToMainWindowMessage(expMessages)); } }