properly pass game name to game string config finder.

add weapon prefix to weapon name parser for (iw5).
add some iw3 game strings
This commit is contained in:
RaidMax
2021-03-23 16:01:48 -05:00
parent 1f9c80e23b
commit e777a68105
6 changed files with 74 additions and 14 deletions

View File

@ -1,23 +1,24 @@
using System.Collections.Generic;
using Data.Models;
using Humanizer;
namespace SharedLibraryCore.Configuration
{
public class GameStringConfiguration : Dictionary<Server.Game, Dictionary<string, string>>
public class GameStringConfiguration : Dictionary<Reference.Game, Dictionary<string, string>>
{
public string GetStringForGame(string key, Server.Game game = Server.Game.IW4)
public string GetStringForGame(string key, Reference.Game? game = Reference.Game.IW4)
{
if (key == null)
{
return null;
}
if (!ContainsKey(game))
if (!ContainsKey(game.Value))
{
return key.Transform(To.TitleCase);
}
var strings = this[game];
var strings = this[game.Value];
return !strings.ContainsKey(key) ? key.Transform(To.TitleCase) : strings[key];
}
}