using SharedLibrary; using SharedLibrary.Helpers; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace StatsPlugin.Helpers { public class StreakMessage { /// /// Get a message from the configuration encouraging or discouraging clients /// /// how many kills the client has without dying /// how many deaths the client has without getting a kill /// message to send to the client public static string MessageOnStreak(int killStreak, int deathStreak) { var killstreakMessage = Plugin.Config.Configuration().KillstreakMessages; var deathstreakMessage = Plugin.Config.Configuration().DeathstreakMessages; string message = killstreakMessage.FirstOrDefault(m => m.Count == killStreak)?.Message; message = (message == null) ? deathstreakMessage.FirstOrDefault(m => m.Count == deathStreak)?.Message : message; return message ?? ""; } } }