v1.5.7.0 (Summer Update)

This commit is contained in:
Regalis11
2024-06-18 16:49:51 +03:00
parent 4a63dacbce
commit 230d1b6e78
263 changed files with 7792 additions and 2845 deletions
@@ -0,0 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using System.Collections.Immutable;
namespace Barotrauma
{
[NetworkSerialize]
public readonly record struct NetCollection<T>(ImmutableArray<T> Array) : INetSerializableStruct, IEnumerable<T>
{
public static readonly NetCollection<T> Empty = new(ImmutableArray<T>.Empty);
public NetCollection(params T[] elements) : this(elements.ToImmutableArray()) { }
IEnumerator<T> IEnumerable<T>.GetEnumerator() => ((IEnumerable<T>)Array).GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable)Array).GetEnumerator();
}
}