2023-02-11 22:01:28 -05:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using Stats.Config;
|
2018-02-09 02:21:25 -05:00
|
|
|
|
|
2023-02-11 22:01:28 -05:00
|
|
|
|
namespace IW4MAdmin.Plugins.Stats.Helpers;
|
|
|
|
|
|
|
|
|
|
public static class StreakMessage
|
2018-02-09 02:21:25 -05:00
|
|
|
|
{
|
2023-02-11 22:01:28 -05:00
|
|
|
|
public static string MessageOnStreak(int killStreak, int deathStreak, StatsConfiguration config)
|
2018-02-09 02:21:25 -05:00
|
|
|
|
{
|
2023-02-11 22:01:28 -05:00
|
|
|
|
var killstreakMessage = config.KillstreakMessages;
|
|
|
|
|
var deathstreakMessage = config.DeathstreakMessages;
|
2018-02-09 02:21:25 -05:00
|
|
|
|
|
2023-02-11 22:01:28 -05:00
|
|
|
|
var message = killstreakMessage?.FirstOrDefault(m => m.Count == killStreak)?.Message;
|
|
|
|
|
message ??= deathstreakMessage?.FirstOrDefault(m => m.Count == deathStreak)?.Message;
|
|
|
|
|
return message ?? "";
|
2018-02-09 02:21:25 -05:00
|
|
|
|
}
|
|
|
|
|
}
|