2021-03-22 12:09:25 -04:00
|
|
|
|
using System.Collections.Generic;
|
2021-03-23 17:01:48 -04:00
|
|
|
|
using Data.Models;
|
2021-03-22 12:09:25 -04:00
|
|
|
|
using Humanizer;
|
|
|
|
|
|
|
|
|
|
namespace SharedLibraryCore.Configuration
|
|
|
|
|
{
|
2021-03-23 17:01:48 -04:00
|
|
|
|
public class GameStringConfiguration : Dictionary<Reference.Game, Dictionary<string, string>>
|
2021-03-22 12:09:25 -04:00
|
|
|
|
{
|
2021-03-23 17:01:48 -04:00
|
|
|
|
public string GetStringForGame(string key, Reference.Game? game = Reference.Game.IW4)
|
2021-03-22 12:09:25 -04:00
|
|
|
|
{
|
|
|
|
|
if (key == null)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 17:01:48 -04:00
|
|
|
|
if (!ContainsKey(game.Value))
|
2021-03-22 12:09:25 -04:00
|
|
|
|
{
|
|
|
|
|
return key.Transform(To.TitleCase);
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 17:01:48 -04:00
|
|
|
|
var strings = this[game.Value];
|
2021-03-22 12:09:25 -04:00
|
|
|
|
return !strings.ContainsKey(key) ? key.Transform(To.TitleCase) : strings[key];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|