Files
Fishing2Server/Tools/ConfigBuilder/NBConfigBuilder/Core/StringDictionaryConfig.cs
2025-09-27 17:53:39 +08:00

25 lines
512 B
C#

namespace NBConfigBuilder;
public sealed partial class StringDictionaryConfig
{
public Dictionary<int, string> Dic;
public string this[int key] => GetValue(key);
public bool TryGetValue(int key, out string value)
{
value = default;
if (!Dic.ContainsKey(key))
{
return false;
}
value = Dic[key];
return true;
}
private string GetValue(int key)
{
return Dic.TryGetValue(key, out var value) ? value : null;
}
}