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