Release 1.9.7.0 - Summer Update 2025

This commit is contained in:
Regalis11
2025-06-17 16:38:11 +03:00
parent 22227f13e5
commit ea5a2bc693
297 changed files with 7344 additions and 2421 deletions
@@ -45,6 +45,20 @@ namespace Barotrauma
{
OnSort = onSort;
}
/// <summary>
/// For iterating through the Prefabs in a deterministic order (e.g. for map generation). Sorting is not cached, so use sparingly.
/// </summary>
public IOrderedEnumerable<T> GetOrdered()
{
// UintIdentifier comparison is preferred to Identifier comparison that uses strings
if ((typeof(T).IsAssignableFrom(typeof(PrefabWithUintIdentifier))))
{
return this.OrderBy(p => (p as PrefabWithUintIdentifier)!.UintIdentifier);
}
return this.OrderBy(p => p.Identifier);
}
/// <summary>
/// Method to be called when calling Add(T prefab, bool override).