v1.5.7.0 (Summer Update)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user