Interface IGhostSerializer<TComponent, TSnapshot>
Interface implemented by all the component/buffer serialiser. For internal use only.
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
[RequireImplementors]
[Obsolete("The IGhostSerializer<TComponent, TSnapshot> has been deprecated. Please use the IGhostComponentSerializer instead")]
public interface IGhostSerializer<TComponent, TSnapshot> where TComponent : unmanaged where TSnapshot : unmanaged
Type Parameters
Name | Description |
---|---|
TComponent | The component type that this interface serialize. |
TSnapshot | The snapshot struct type that will contains the component data. |
Methods
CalculateChangeMaskGenerated(in TSnapshot, in TSnapshot, IntPtr, int)
Compute the change mask for the snapshot in respect to the given baseline
Declaration
void CalculateChangeMaskGenerated(in TSnapshot snapshot, in TSnapshot baseline, IntPtr changeMaskData, int startOffset)
Parameters
CopyFromSnapshotGenerated(in GhostDeserializerState, ref TComponent, float, float, in TSnapshot, in TSnapshot)
Copy/Convert the data form the snapshot to the component. Support interpolation and extrapolation.
Declaration
void CopyFromSnapshotGenerated(in GhostDeserializerState serializerState, ref TComponent component, float interpolationFactor, float snapshotInterpolationFactorRaw, in TSnapshot snapshotBefore, in TSnapshot snapshotAfter)
Parameters
Type | Name | Description |
---|---|---|
Ghost |
serializerState | |
TComponent | component | |
float | interpolationFactor | |
float | snapshotInterpolationFactorRaw | |
TSnapshot | snapshotBefore | |
TSnapshot | snapshotAfter |
CopyToSnapshotGenerated(in GhostSerializerState, ref TSnapshot, in TComponent)
Copy/Convert the component data to the snapshot.
Declaration
void CopyToSnapshotGenerated(in GhostSerializerState serializerState, ref TSnapshot snapshot, in TComponent component)
Parameters
Type | Name | Description |
---|---|---|
Ghost |
serializerState | |
TSnapshot | snapshot | |
TComponent | component |
DeserializeGenerated(ref DataStreamReader, in StreamCompressionModel, IntPtr, int, ref TSnapshot, in TSnapshot)
Read the data from the reader
stream into the snapshot data.
Declaration
void DeserializeGenerated(ref DataStreamReader reader, in StreamCompressionModel compressionModel, IntPtr changeMask, int startOffset, ref TSnapshot snapshot, in TSnapshot baseline)
Parameters
Type | Name | Description |
---|---|---|
Data |
reader | |
Stream |
compressionModel | |
Int |
changeMask | |
int | startOffset | |
TSnapshot | snapshot | |
TSnapshot | baseline |
PredictDeltaGenerated(ref TSnapshot, in TSnapshot, in TSnapshot, ref GhostDeltaPredictor)
Calculate the predicted baseline.
Declaration
void PredictDeltaGenerated(ref TSnapshot snapshot, in TSnapshot baseline1, in TSnapshot baseline2, ref GhostDeltaPredictor predictor)
Parameters
Type | Name | Description |
---|---|---|
TSnapshot | snapshot | |
TSnapshot | baseline1 | |
TSnapshot | baseline2 | |
Ghost |
predictor |
ReportPredictionErrorsGenerated(in TComponent, in TComponent, IntPtr, int)
Calculate the prediction error for this component.
Declaration
void ReportPredictionErrorsGenerated(in TComponent component, in TComponent backup, IntPtr errorsList, int errorsCount)
Parameters
RestoreFromBackupGenerated(ref TComponent, in TComponent)
Restore the component data from the prediction backup buffer. Only serialised fields are restored.
Declaration
void RestoreFromBackupGenerated(ref TComponent component, in TComponent backup)
Parameters
Type | Name | Description |
---|---|---|
TComponent | component | |
TComponent | backup |
SerializeCombinedGenerated(in TSnapshot, in TSnapshot, IntPtr, int, ref DataStreamWriter, in StreamCompressionModel)
Serialise the snapshot dato to the writer
based on the calculated changemask.
Declaration
void SerializeCombinedGenerated(in TSnapshot snapshot, in TSnapshot baseline, IntPtr changeMaskData, int startOffset, ref DataStreamWriter writer, in StreamCompressionModel compressionModel)
Parameters
Type | Name | Description |
---|---|---|
TSnapshot | snapshot | |
TSnapshot | baseline | |
Int |
changeMaskData | |
int | startOffset | |
Data |
writer | |
Stream |
compressionModel |
SerializeGenerated(in TSnapshot, in TSnapshot, IntPtr, int, ref DataStreamWriter, in StreamCompressionModel)
Serialise the snapshot dato to the writer
based on the calculated changemask.
Declaration
void SerializeGenerated(in TSnapshot snapshot, in TSnapshot baseline, IntPtr changeMaskData, int startOffset, ref DataStreamWriter writer, in StreamCompressionModel compressionModel)