Faction Test 100.4.0.0
This commit is contained in:
@@ -82,7 +82,13 @@ namespace Barotrauma.Extensions
|
||||
return count == 0 ? default : source.ElementAt(Rand.Range(0, count, Rand.RandSync.Unsynced));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static T GetRandom<T>(this IEnumerable<T> source, Random rand)
|
||||
where T : PrefabWithUintIdentifier
|
||||
{
|
||||
return source.OrderBy(p => p.UintIdentifier).ToArray().GetRandom(rand);
|
||||
}
|
||||
|
||||
public static T GetRandom<T>(this IEnumerable<T> source, Rand.RandSync randSync)
|
||||
where T : PrefabWithUintIdentifier
|
||||
{
|
||||
@@ -218,6 +224,8 @@ namespace Barotrauma.Extensions
|
||||
return new Dictionary<TKey, TValue>(immutableDictionary);
|
||||
}
|
||||
|
||||
public static NetCollection<T> ToNetCollection<T>(this IEnumerable<T> enumerable) => new NetCollection<T>(enumerable.ToImmutableArray());
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether a given collection has at least a certain amount
|
||||
/// of elements for which the predicate returns true.
|
||||
|
||||
Reference in New Issue
Block a user