Struct FixedListByte128
An unmanaged, resizable list of byte that does not allocate memory. It is 128 bytes in size, and contains all the memory it needs.
Namespace: Unity.Collections
Syntax
public struct FixedListByte128 : IEnumerable<byte>, IEnumerable, IEquatable<FixedListByte32>, IComparable<FixedListByte32>, IEquatable<FixedListByte64>, IComparable<FixedListByte64>, IEquatable<FixedListByte128>, IComparable<FixedListByte128>
Constructors
FixedListByte128(FixedListByte32)
Constructs a new FixedListByte128 that is a copy of a FixedListByte32.
Declaration
public FixedListByte128(in FixedListByte32 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte32 | other | The FixedListByte32 to copy |
FixedListByte128(FixedListByte64)
Constructs a new FixedListByte128 that is a copy of a FixedListByte64.
Declaration
public FixedListByte128(in FixedListByte64 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte64 | other | The FixedListByte64 to copy |
Properties
Capacity
The number of items that can fit in the list.
Declaration
public int Capacity { get; }
Property Value
Type | Description |
---|---|
Int32 | The number of items that the list can hold. |
Remarks
Capacity specifies the number of items the list can currently hold. You can not change Capacity to fit more or fewer items.
Item[Int32]
Retrieve a member of the list by index.
Declaration
public byte this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index into the list. |
Property Value
Type | Description |
---|---|
Byte | The list item at the specified index. |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if index is negative or >= to Length. |
Length
The current number of items in the list.
Declaration
public int Length { get; set; }
Property Value
Type | Description |
---|---|
Int32 | The item length. |
Methods
Add(Byte)
Adds an element to the list.
Declaration
public void Add(byte item)
Parameters
Type | Name | Description |
---|---|---|
Byte | item |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if list is already full. See Capacity. |
AddNoResize(Byte)
Adds an element to the list.
Declaration
public void AddNoResize(byte item)
Parameters
Type | Name | Description |
---|---|---|
Byte | item |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if list is already full. See Capacity. |
Clear()
Clears the list.
Declaration
public void Clear()
CompareTo(FixedListByte128)
Compares this instance with a specified FixedListByte128 and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified FixedListByte128.
Declaration
public int CompareTo(FixedListByte128 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte128 | other | The specified FixedListByte128 to compare with |
Returns
Type | Description |
---|---|
Int32 |
CompareTo(FixedListByte32)
Compares this instance with a specified FixedListByte32 and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified FixedListByte32.
Declaration
public int CompareTo(FixedListByte32 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte32 | other | The specified FixedListByte32 to compare with |
Returns
Type | Description |
---|---|
Int32 |
CompareTo(FixedListByte64)
Compares this instance with a specified FixedListByte64 and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified FixedListByte64.
Declaration
public int CompareTo(FixedListByte64 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte64 | other | The specified FixedListByte64 to compare with |
Returns
Type | Description |
---|---|
Int32 |
Contains(Byte)
Determines whether an element is in the FixedListByte128.
Declaration
public bool Contains(byte item)
Parameters
Type | Name | Description |
---|---|---|
Byte | item | The object to locate in the FixedListByte128. |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
Compares this instance with a specified object and indicates whether this instance is equal to the specified object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The specified object to compare with for equality |
Returns
Type | Description |
---|---|
Boolean |
Overrides
Equals(FixedListByte128)
Compares this instance with a specified FixedListByte128 and indicates whether this instance is equal to the specified FixedListByte128.
Declaration
public bool Equals(FixedListByte128 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte128 | other | The specified FixedListByte128 to compare with for equality |
Returns
Type | Description |
---|---|
Boolean |
Equals(FixedListByte32)
Compares this instance with a specified FixedListByte32 and indicates whether this instance is equal to the specified FixedListByte32.
Declaration
public bool Equals(FixedListByte32 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte32 | other | The specified FixedListByte32 to compare with for equality |
Returns
Type | Description |
---|---|
Boolean |
Equals(FixedListByte64)
Compares this instance with a specified FixedListByte64 and indicates whether this instance is equal to the specified FixedListByte64.
Declaration
public bool Equals(FixedListByte64 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte64 | other | The specified FixedListByte64 to compare with for equality |
Returns
Type | Description |
---|---|
Boolean |
GetEnumerator()
Declaration
public FixedListByte128.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
FixedListByte128.Enumerator |
GetHashCode()
Computes a hash code summary of the FixedListByte128.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
IndexOf(Byte)
Searches for the specified byte and returns the zero-based index of the first occurrence within the entire FixedListByte128.
Declaration
public int IndexOf(byte item)
Parameters
Type | Name | Description |
---|---|---|
Byte | item | The byte to locate in the FixedListByte128. |
Returns
Type | Description |
---|---|
Int32 |
IndexOf(Byte, Int32)
Searches for the specified byte and returns the zero-based index of the first occurrence within the range of elements in the FixedListByte128 that starts at the specified index.
Declaration
public int IndexOf(byte item, int index)
Parameters
Type | Name | Description |
---|---|---|
Byte | item | The byte to locate in the FixedListByte128. |
Int32 | index | The zero-based starting index of the search. 0 (zero) is valid in an empty list. |
Returns
Type | Description |
---|---|
Int32 |
IndexOf(Byte, Int32, Int32)
Searches for the specified byte and returns the zero-based index of the first occurrence within the range of elements in the FixedListByte128 that starts at the specified index and contains the specified number of elements.
Declaration
public int IndexOf(byte item, int index, int count)
Parameters
Type | Name | Description |
---|---|---|
Byte | item | The byte to locate in the FixedListByte128. |
Int32 | index | The zero-based starting index of the search. 0 (zero) is valid in an empty list. |
Int32 | count | The number of elements in the section to search. |
Returns
Type | Description |
---|---|
Int32 |
Insert(Int32, Byte)
Inserts a single element into a FixedListByte128 at a specified zero-based index.
Declaration
public void Insert(int index, byte item)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index at which the new element should be inserted. |
Byte | item | The element to insert |
InsertRange(Int32, Int32)
Inserts a number of items into a FixedListByte128 at a specified zero-based index.
Declaration
public void InsertRange(int begin, int items)
Parameters
Type | Name | Description |
---|---|---|
Int32 | begin | The zero-based index at which the new elements should be inserted. |
Int32 | items | The number of items to insert |
Remove(Byte)
Searches for the specified byte from the begining of the FixedListByte128 forward, removes it if possible, and returns true if the byte was successfully removed.
Declaration
public bool Remove(byte item)
Parameters
Type | Name | Description |
---|---|---|
Byte | item | The byte to locate in the FixedListByte128 |
Returns
Type | Description |
---|---|
Boolean |
RemoveAt(Int32)
Removes the byte at the specified index, and copies all subsequent elements backward to fill the hole so created.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index at which to remove the byte |
RemoveAtSwapBack(Int32)
Removes an element from the FixedListByte128 at the specified index and replaces it with the last element, which can be much faster than copying down all subsequent elements.
Declaration
public void RemoveAtSwapBack(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index of the elements to remove. |
RemoveRange(Int32, Int32)
Removes a number of elements from a FixedListByte128 at a specified zero-based index.
Declaration
public void RemoveRange(int begin, int items)
Parameters
Type | Name | Description |
---|---|---|
Int32 | begin | The zero-based index at which the elements should be removed. |
Int32 | items | The number of elements to remove |
RemoveSwapBack(Byte)
Removes the first occurrence of an item from the FixedListByte128 and replaces it with the last element, which can be much faster than copying down all subsequent elements.
Declaration
public void RemoveSwapBack(byte item)
Parameters
Type | Name | Description |
---|---|---|
Byte | item | The elements to remove from the FixedListByte128. |
Sort()
Sorts the elements in this FixedListByte128.
Declaration
public void Sort()
ToArray()
Creates a managed Array of byte that is a copy of this FixedListByte128.
Declaration
public byte[] ToArray()
Returns
Type | Description |
---|---|
Byte[] |
ToNativeArray(Allocator)
Creates an unmanaged NativeArraybyte that is a copy of this FixedListByte128.
Declaration
public NativeArray<byte> ToNativeArray(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator |
Returns
Type | Description |
---|---|
NativeArray<Byte> |
Operators
Equality(FixedListByte128, FixedListByte128)
Determines whether a FixedListByte128 and FixedListByte128 have the same value.
Declaration
public static bool operator ==(in FixedListByte128 a, in FixedListByte128 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte128 | a | The FixedListByte128 to compare for equality |
FixedListByte128 | b | The FixedListByte128 to compare for equality |
Returns
Type | Description |
---|---|
Boolean |
Equality(FixedListByte128, FixedListByte32)
Determines whether a FixedListByte128 and FixedListByte32 have the same value.
Declaration
public static bool operator ==(in FixedListByte128 a, in FixedListByte32 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte128 | a | The FixedListByte128 to compare for equality |
FixedListByte32 | b | The FixedListByte32 to compare for equality |
Returns
Type | Description |
---|---|
Boolean |
Equality(FixedListByte128, FixedListByte64)
Determines whether a FixedListByte128 and FixedListByte64 have the same value.
Declaration
public static bool operator ==(in FixedListByte128 a, in FixedListByte64 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte128 | a | The FixedListByte128 to compare for equality |
FixedListByte64 | b | The FixedListByte64 to compare for equality |
Returns
Type | Description |
---|---|
Boolean |
Implicit(FixedListByte32 to FixedListByte128)
Implicitly converts a FixedListByte32 to a FixedListByte128.
Declaration
public static implicit operator FixedListByte128(in FixedListByte32 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte32 | other | The FixedListByte32 to copy |
Returns
Type | Description |
---|---|
FixedListByte128 |
Implicit(FixedListByte64 to FixedListByte128)
Implicitly converts a FixedListByte64 to a FixedListByte128.
Declaration
public static implicit operator FixedListByte128(in FixedListByte64 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte64 | other | The FixedListByte64 to copy |
Returns
Type | Description |
---|---|
FixedListByte128 |
Inequality(FixedListByte128, FixedListByte128)
Determines whether a FixedListByte128 and FixedListByte128 have different values.
Declaration
public static bool operator !=(in FixedListByte128 a, in FixedListByte128 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte128 | a | The FixedListByte128 to compare for inequality |
FixedListByte128 | b | The FixedListByte128 to compare for inequality |
Returns
Type | Description |
---|---|
Boolean |
Inequality(FixedListByte128, FixedListByte32)
Determines whether a FixedListByte128 and FixedListByte32 have different values.
Declaration
public static bool operator !=(in FixedListByte128 a, in FixedListByte32 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte128 | a | The FixedListByte128 to compare for inequality |
FixedListByte32 | b | The FixedListByte32 to compare for inequality |
Returns
Type | Description |
---|---|
Boolean |
Inequality(FixedListByte128, FixedListByte64)
Determines whether a FixedListByte128 and FixedListByte64 have different values.
Declaration
public static bool operator !=(in FixedListByte128 a, in FixedListByte64 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListByte128 | a | The FixedListByte128 to compare for inequality |
FixedListByte64 | b | The FixedListByte64 to compare for inequality |
Returns
Type | Description |
---|---|
Boolean |