Updated GetBot to pop last item off instead of first

Updated `GetX` to expect an IList
This commit is contained in:
Chomp
2025-02-01 20:31:26 +00:00
parent a59e636554
commit c58fa1ec7a
2 changed files with 4 additions and 4 deletions
@@ -1,4 +1,4 @@
using SptCommon.Annotations;
using SptCommon.Annotations;
using Core.Models.Eft.Common.Tables;
using Core.Models.Utils;
using SptCommon.Extensions;
@@ -50,7 +50,7 @@ public class BotGenerationCacheService(
{
try
{
return bots.PopFirst();
return bots.PopLast();
}
catch (Exception _)
{
+2 -2
View File
@@ -9,14 +9,14 @@ public static class ListExtensions
return items;
}
public static T PopFirst<T>(this List<T> source)
public static T PopFirst<T>(this IList<T> source)
{
T r = source.First();
source.Remove(source.First());
return r;
}
public static T PopLast<T>(this List<T> source)
public static T PopLast<T>(this IList<T> source)
{
T r = source.Last();
source.Remove(source.Last());