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

25 lines
487 B
C#

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