mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-07 21:58:06 -05:00
26 lines
649 B
C#
26 lines
649 B
C#
using System.Collections.Generic;
|
|
using Data.Models;
|
|
using Humanizer;
|
|
|
|
namespace SharedLibraryCore.Configuration
|
|
{
|
|
public class GameStringConfiguration : Dictionary<Reference.Game, Dictionary<string, string>>
|
|
{
|
|
public string GetStringForGame(string key, Reference.Game? game = Reference.Game.IW4)
|
|
{
|
|
if (key == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
if (!ContainsKey(game.Value))
|
|
{
|
|
return key;
|
|
}
|
|
|
|
var strings = this[game.Value];
|
|
return !strings.TryGetValue(key, out var value) ? key : value;
|
|
}
|
|
}
|
|
}
|