Photon Fusion
2.1.1
Fusion type for networking arrays. Maximum capacity is fixed, and is set with the CapacityAttribute.
.
More...
Inherits INetworkArray.
Classes | |
| struct | Enumerator |
| Enumerator for NetworkArray. More... | |
Public Member Functions | |
| void | Clear () |
| Clears the array, setting all values to default. | |
| void | CopyFrom (List< T > source, int sourceOffset, int sourceCount) |
| Copies a range of values from a supplied source list into the NetworkArray. | |
| void | CopyFrom (T[] source, int sourceOffset, int sourceCount) |
| Copies a range of elements from a source array into the NetworkArray. | |
| void | CopyTo (List< T > list) |
| Adds each value to the supplied List. This does not clear the list, so values will be appended to the existing list. | |
| void | CopyTo (NetworkArray< T > array) |
| Copies values to the supplied array. | |
| void | CopyTo (T[] array, bool throwIfOverflow=true) |
| Copies values to the supplied array. | |
| void | Dispose () |
| Releases all resources used by the Enumerator. | |
| Enumerator (NetworkArray< T > array) | |
| Initializes a new instance of the Enumerator with the specified NetworkArray. | |
| readonly T | Get (int index) |
| Returns the array value at supplied index. | |
| Enumerator | GetEnumerator () |
| Returns an enumerator that iterates through the collection. | |
| bool | MoveNext () |
| Advances the enumerator to the next element of the collection. | |
| NetworkArray (byte *array, int length, IElementReaderWriter< T > readerWriter) | |
| NetworkArray constructor. | |
| void | Reset () |
| Sets the enumerator to its initial position, which is before the first element in the collection. | |
| T | Set (int index, T value) |
| Sets the array value at the supplied index. | |
| T[] | ToArray () |
| Allocates a new array and copies values from this array. For a non-alloc alternative use CopyTo(List<T>). | |
| readonly string | ToListString () |
| Returns the elements of this array as a string, with value separated by characters. Specifically for use in the Unity inspector. This is private and only is found by NetworkBehaviourEditor using reflection, so do not rename this method. | |
| NetworkArrayReadOnly< T > | ToReadOnly () |
| Returns a NetworkArrayReadOnly view of this array. | |
| override readonly string | ToString () |
| Returns a string that represents the current object. | |
Static Public Member Functions | |
| static implicit | operator NetworkArrayReadOnly< T > (NetworkArray< T > value) |
| Returns a NetworkArrayReadOnly view of this array. | |
Properties | |
| object IEnumerator. | Current [get] |
| Gets the current element in the collection. | |
| readonly T | Current [get] |
| Gets the current element in the collection. | |
| readonly int | Length [get] |
| The fixed size of the array. | |
| object INetworkArray. | this[int index] [get, set] |
| Gets or sets the element at the specified index. | |
| T | this[int index] [get, set] |
| Indexer of array elements. | |
Fusion type for networking arrays. Maximum capacity is fixed, and is set with the CapacityAttribute.
.
Typical Usage:
Optional usage (for NetworkBehaviours ONLY - this is not legal in INetworkStructs):
Usage for modifying data:
| T | T can be a primitive, or an INetworkStruct. |
| void CopyFrom | ( | List< T > | source, |
| int | sourceOffset, | ||
| int | sourceCount ) |
Copies a range of values from a supplied source list into the NetworkArray.
| source | The source list from which to copy elements. |
| sourceOffset | The zero-based index in the source list at which copying begins. |
| sourceCount | The number of elements to copy from the source list. |
| ArgumentNullException | Thrown when the provided source list is null. |
| ArgumentException | Thrown when the number of elements to copy is greater than the length of the NetworkArray. |
| ArgumentOutOfRangeException | Thrown when the sum of sourceOffset and sourceCount is greater than the length of the source list. |
| void CopyFrom | ( | T[] | source, |
| int | sourceOffset, | ||
| int | sourceCount ) |
Copies a range of elements from a source array into the NetworkArray.
| source | The source array from which to copy elements. Must not be null. |
| sourceOffset | The zero-based index in the source array at which copying begins. |
| sourceCount | The number of elements to copy from the source array. |
| ArgumentNullException | Thrown when the provided source array is null. |
| ArgumentException | Thrown when the number of elements to copy is greater than the length of the NetworkArray. |
| ArgumentOutOfRangeException | Thrown when the sum of sourceOffset and sourceCount is greater than the length of the source array. |
| void CopyTo | ( | NetworkArray< T > | array | ) |
Copies values to the supplied array.
| array | NetworkArray to copy to. |
| ArgumentException | Thrown if the supplied array is smaller than this NetworkArray<T>. |
| void CopyTo | ( | T[] | array, |
| bool | throwIfOverflow = true ) |
Copies values to the supplied array.
| array | Array to copy to. |
| throwIfOverflow | If true, this method will throw an error if the supplied array is smaller than this NetworkArray<T>. If false, will only copy as many elements as the target array can hold. |
| Enumerator | ( | NetworkArray< T > | array | ) |
Initializes a new instance of the Enumerator with the specified NetworkArray.
| array | The NetworkArray to enumerate. |
| bool MoveNext | ( | ) |
Advances the enumerator to the next element of the collection.
|
static |
Returns a NetworkArrayReadOnly view of this array.
| value | NetworkArray to convert. |
|
getset |
Gets or sets the element at the specified index.
| index | The zero-based index of the element to get or set. |
Implements INetworkArray.