SCHALE.GameServer/SCHALE.Common/Utils/AccDict.cs

18 lines
390 B
C#
Raw Permalink Normal View History

2024-06-03 07:42:23 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SCHALE.Common.Utils
{
public class AccDict<T> : Dictionary<T, int> where T : notnull
{
public new int this[T key]
{
get => TryGetValue(key, out var value) ? value : 0;
set => base[key] = value;
}
}
}