Photon Fusion 2.0.4

Public Member Functions | Static Public Member Functions | Properties | List of all members
NetworkBehaviourBuffer Struct Reference

Provides low level accesss to data buffers that can be read using a NetworkBehaviour.Reader More...

Public Member Functions

float Read (NetworkBehaviour.PropertyReader< float > reader)
 Reads a float property from the buffer using the provided PropertyReader. More...
 
Quaternion Read (NetworkBehaviour.PropertyReader< Quaternion > reader)
 Reads a Quaternion property from the buffer using the provided PropertyReader. More...
 
Vector2 Read (NetworkBehaviour.PropertyReader< Vector2 > reader)
 Reads a Vector2 property from the buffer using the provided PropertyReader. More...
 
Vector3 Read (NetworkBehaviour.PropertyReader< Vector3 > reader)
 Reads a Vector3 property from the buffer using the provided PropertyReader. More...
 
Vector4 Read (NetworkBehaviour.PropertyReader< Vector4 > reader)
 Reads a Vector4 property from the buffer using the provided PropertyReader. More...
 
Read< T > (NetworkBehaviour.BehaviourReader< T > reader)
 Reads a NetworkBehaviour from the buffer using the provided BehaviourReader. More...
 
Read< T > (NetworkBehaviour.PropertyReader< T > reader)
 Reads a property from the buffer using the provided PropertyReader. More...
 
unsafe T ReinterpretState< T > (int offset=0)
 Reinterprets the state of the buffer at a given offset as a specific type. More...
 

Static Public Member Functions

static implicit operator bool (NetworkBehaviourBuffer buffer)
 Implicit conversion operator to bool. This allows a NetworkBehaviourBuffer instance to be used in conditions directly. More...
 

Properties

int Length [get]
 Gets the length of the buffer. More...
 
int this[int index] [get]
 Indexer to get the value at a specific index in the buffer. More...
 
Tick Tick [get]
 Gets the tick at which the buffer was created. More...
 
bool Valid [get]
 Gets a value indicating whether the buffer is valid. A buffer is considered valid if the pointer to the start of the buffer is not null and the length of the buffer is greater than 0. More...
 

Detailed Description

Provides low level accesss to data buffers that can be read using a NetworkBehaviour.Reader

Member Function Documentation

◆ operator bool()

static implicit operator bool ( NetworkBehaviourBuffer  buffer)
static

Implicit conversion operator to bool. This allows a NetworkBehaviourBuffer instance to be used in conditions directly.

Parameters
bufferThe NetworkBehaviourBuffer instance to convert.
Returns
True if the buffer is valid, false otherwise.

◆ Read() [1/5]

float Read ( NetworkBehaviour.PropertyReader< float >  reader)

Reads a float property from the buffer using the provided PropertyReader.

Parameters
readerThe PropertyReader to use for reading the float property.
Returns
The read float property.

◆ Read() [2/5]

Quaternion Read ( NetworkBehaviour.PropertyReader< Quaternion >  reader)

Reads a Quaternion property from the buffer using the provided PropertyReader.

Parameters
readerThe PropertyReader to use for reading the Quaternion property.
Returns
The read Quaternion property.

◆ Read() [3/5]

Vector2 Read ( NetworkBehaviour.PropertyReader< Vector2 >  reader)

Reads a Vector2 property from the buffer using the provided PropertyReader.

Parameters
readerThe PropertyReader to use for reading the Vector2 property.
Returns
The read Vector2 property.

◆ Read() [4/5]

Vector3 Read ( NetworkBehaviour.PropertyReader< Vector3 >  reader)

Reads a Vector3 property from the buffer using the provided PropertyReader.

Parameters
readerThe PropertyReader to use for reading the Vector3 property.
Returns
The read Vector3 property.

◆ Read() [5/5]

Vector4 Read ( NetworkBehaviour.PropertyReader< Vector4 >  reader)

Reads a Vector4 property from the buffer using the provided PropertyReader.

Parameters
readerThe PropertyReader to use for reading the Vector4 property.
Returns
The read Vector4 property.

◆ Read< T >() [1/2]

T Read< T > ( NetworkBehaviour.BehaviourReader< T >  reader)

Reads a NetworkBehaviour from the buffer using the provided BehaviourReader.

Template Parameters
TThe type of NetworkBehaviour to read. Must be a subclass of NetworkBehaviour.
Parameters
readerThe BehaviourReader to use for reading the NetworkBehaviour.
Returns
The read NetworkBehaviour.
Type Constraints
T :NetworkBehaviour 

◆ Read< T >() [2/2]

T Read< T > ( NetworkBehaviour.PropertyReader< T >  reader)

Reads a property from the buffer using the provided PropertyReader.

Template Parameters
TThe type of the property to read. Must be unmanaged.
Parameters
readerThe PropertyReader to use for reading the property.
Returns
The read property.
Type Constraints
T :unmanaged 

◆ ReinterpretState< T >()

unsafe T ReinterpretState< T > ( int  offset = 0)

Reinterprets the state of the buffer at a given offset as a specific type.

Template Parameters
TThe type to reinterpret the state as. Must be unmanaged.
Parameters
offsetThe offset at which to start reinterpreting. Defaults to 0.
Returns
The state of the buffer at the given offset, reinterpreted as the specified type.
Type Constraints
T :unmanaged 

Property Documentation

◆ Length

int Length
get

Gets the length of the buffer.

◆ this[int index]

int this[int index]
get

Indexer to get the value at a specific index in the buffer.

Parameters
indexThe index to get the value from.
Returns
The value at the specified index in the buffer.

◆ Tick

Tick Tick
get

Gets the tick at which the buffer was created.

◆ Valid

bool Valid
get

Gets a value indicating whether the buffer is valid. A buffer is considered valid if the pointer to the start of the buffer is not null and the length of the buffer is greater than 0.