2018-02-10 23:33:42 -05:00
|
|
|
|
using SharedLibrary;
|
|
|
|
|
using SharedLibrary.Helpers;
|
|
|
|
|
using System;
|
2018-02-09 02:21:25 -05:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace StatsPlugin.Helpers
|
|
|
|
|
{
|
|
|
|
|
public class StreakMessage
|
|
|
|
|
{
|
2018-02-10 23:33:42 -05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get a message from the configuration encouraging or discouraging clients
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="killStreak">how many kills the client has without dying</param>
|
|
|
|
|
/// <param name="deathStreak">how many deaths the client has without getting a kill</param>
|
|
|
|
|
/// <returns>message to send to the client</returns>
|
2018-03-18 22:25:11 -04:00
|
|
|
|
public static string MessageOnStreak(int killStreak, int deathStreak)
|
2018-02-10 23:33:42 -05:00
|
|
|
|
{
|
2018-03-18 22:25:11 -04:00
|
|
|
|
var killstreakMessage = Plugin.Config.Configuration().KillstreakMessages;
|
|
|
|
|
var deathstreakMessage = Plugin.Config.Configuration().DeathstreakMessages;
|
2018-02-09 02:21:25 -05:00
|
|
|
|
|
2018-03-18 22:25:11 -04:00
|
|
|
|
string message = killstreakMessage.FirstOrDefault(m => m.Count == killStreak)?.Message;
|
2018-03-22 14:50:09 -04:00
|
|
|
|
message = message ?? deathstreakMessage.FirstOrDefault(m => m.Count == deathStreak)?.Message;
|
2018-03-18 22:25:11 -04:00
|
|
|
|
return message ?? "";
|
2018-02-09 02:21:25 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|