bloxstrap/Bloxstrap/Utility/FixedCapacityList.cs
Matt c1842c0443
Replace AssetDelivery API with Thumbnails API for Discord RPC images (#4947)
* replace assetdelivery with thumbnails for rpc

* update GetThumbnailUrlAsync logging

* fix build error
2025-03-28 19:33:51 +00:00

26 lines
490 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Bloxstrap.Utility
{
internal class FixedSizeList<T> : List<T>
{
public int MaxSize { get; }
public FixedSizeList(int size)
{
MaxSize = size;
}
public new void Add(T item)
{
if (Count >= MaxSize)
RemoveAt(Count - 1);
base.Add(item);
}
}
}