Skip to content

Commit

Permalink
remove field keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielWillett committed Nov 23, 2024
1 parent e4fab06 commit 06d59ca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions UncreatedWarfare/Translations/TranslationValueFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ public class TranslationValueFormatter : ITranslationValueFormatter
{
private readonly IServiceProvider _serviceProvider;
private readonly Type _enumFormatter;
private LanguageService _languageService;
private ITranslationService _translationService;

private const string NullNoColor = "null";
private const string NullColorUnity = "<color=#569cd6><b>null</b></color>";
private const string NullColorTMPro = "<#569cd6><b>null</b></color>";
private const string NullANSI = "\e[94mnull\e[39m";
private const string NullExtendedANSI = "\e[38;2;86;156;214mnull\e[39m";

public LanguageService LanguageService => field ??= _serviceProvider.GetRequiredService<LanguageService>();
public ITranslationService TranslationService => field ??= _serviceProvider.GetRequiredService<ITranslationService>();
public LanguageService LanguageService => _languageService ??= _serviceProvider.GetRequiredService<LanguageService>();
public ITranslationService TranslationService => _translationService ??= _serviceProvider.GetRequiredService<ITranslationService>();

private readonly ConcurrentDictionary<Type, object> _valueFormatters = new ConcurrentDictionary<Type, object>();
public TranslationValueFormatter(IServiceProvider serviceProvider, IConfiguration systemConfig)
Expand All @@ -44,6 +46,8 @@ public TranslationValueFormatter(IServiceProvider serviceProvider, IConfiguratio
new ToStringValueFormatter()
};



/// <inheritdoc />
public string Format<T>(T? value, in ValueFormatParameters parameters)
{
Expand Down

0 comments on commit 06d59ca

Please sign in to comment.